Bruce is at least 20 years Barbara's senior, holds a position of power over her, and is, in effect, her employer. That makes what he did morally reprehensible, and "he was lonely" is not an adequate excuse. It was a deep, enduring betrayal of trust on Bruce's part, and a staggeringly large abuse of the comparative power he had over Barbara.
Barbara's at fault, too, and again, "she was lonely" is not an excuse. I wouldn't say her level of betrayal was as severe as Bruce's, but in any scenario, cheating on your partner is a pretty unkind cut, to say nothing of doing it with your partner's best friend/father figure.
They both should have known better, and Dick was right to take it personally.