There are two people in a marriage and neither person is faultless or without some responsibility.
I have behaved incredibly badly at times throughout my marriage. I'm a good person and I love my dh we have been together a long time. We have had issues in the past. We almost broke up, the most serious bolt of horror enveloped me as I started to come out of my fog and look at myself. Wow, what an eye opener that was. The truth is, I just wasn't that nice to him sometimes, really took him and our life together for granted. This epiphany wasn't just mine- dh had his own about his behaviour and our life together....
So we worked on our marriage and ourselves and as a result have a more mature, communicative respectful relationship with each other.
The reason I'm telling you this onit is to demonstrate a another situation where it wasn't perfect, nobody was behaving particularly well within the marriage - sometimes people don't. Good people, kind people who love and respect others. Nobody is perfect.
Marriage is supposed to be a lifetime, forever. If we all sat down and reflected at length on our own behaviour over a period of years none of us would come out of it particularly well on occasion I'm sure.
What is supposed to happen in a marriage is that you try to address these issues - issues that everyone goes through as the marriage evolves - illness, dc, family & work balance etc etc.
What good, decent people don't do is fuck a married friend and break up families while telling his dw it's her fault - for any reason.
You hold NO responsibility for his disgusting behaviour.
I'm sure on reflection there are things you would do different. Use what you've learned about yourself and love and human relationships to develop yourself into an even better version of the already brilliant you.