Im confused??

Okay so one of my best friends and her boyfriend broke up almost 2 months ago and me and him kinda got together after a month but neither of us meant for it to happen and nothing actually happened between us. But then like 10 days later he says he needs to think about things then gets back with her and completely ghosts me, but then makes up lies about another one of my best friends and pisses off the original friend who he was with. Basically he broke up with the original friend, later on got with me (trust me i fully regret letting it happen, but we only texted and it was nothing sexual) then a week later technically breaks up with me and gets back with her and ghosts me completely, then makes up lies about a different friend causing him and the original friend to have a huge fight because he cheated on her. But he didn't say anything about what happened with me and him, even if it was mostly over text. I understand he's messed up but I'm genuinely confused as to what this would accomplish or why he would just completely ghost me, we've been friends for 5 or more years before all of this