He cheated on his girl with me

My extremely stupid action turned out to be not so bad:

I used to talk to this guy i kinda liked and i didnt make any move because he had a girlfriend. I knew they were on a breaking point and they would probably split up. One night when i was very drunk and very stupid i invited him over after a party.. It's no surpise but we had sex.. I felt bad for his girlfriend and i knew that if we told her it would ruin everything. He wanted to break up with her so he could be able to see me again without consequence. it almost happened. I told him he shouldn't do that.. And now he sees in his girlfriend what he saw before and there relationship is finally kinda stable again... It doesn't make my actions right but well... i'm still happy i may have fixed his relationship