kissed my friends ex???

THIS IS SUPER LONG SO SORRY IN ADVANCE so basically I know this girl, let’s call her M. M had a boyfriend named P. M and I were best friends but slowly she started changing. she started cheating on her boyfriend, getting really touchy with my (now ex) boyfriend, always complaining that she wanted more friends and to hang out with people other than me even though she still used me for rides home from school every day (we’re juniors in hs). she was just an all together bad friend and she moved at the end of summer so we pretty much stopped talking aside from a casual conversation here and there. she broke up with her boyfriend but still had sex with him and continued to string him along and lie to him and say she was only sleeping with him when she told everyone else otherwise. me and her ex boyfriend are friends and gym buddies and the other day we were at the gym and it all came out. the cheating thing. the other guys thing. everything. and while I feel like I should have kept my mouth shut, he deserved to know the truth. i’ve never had any type of feelings for him but he kissed me later during the day and I felt awkward so I didn’t pull away. but I woke up the next morning feeling sooo guilty. so I guess I just want to know, was I wrong for not pulling away. I definitely don’t plan on doing anything with him in the future and I truly have no feelings for him but I wonder if it was still wrong to kiss someone who was at one point the boyfriend of someone who I was very close with? i’ve talked to multiple friends about the telling him that she cheated thing and they all say I should have kept my mouth shut but that just feels so wrong to me, he deserved to know the truth. I guess I just want to know honest opinions on the whole situation.