You didn’t deserve to be treated this way. And even though you can think about your relation with a lot of “if”, it was still their decision and responsability to flirt with others.
There’s always different interpretations in an argument. It’s not because your friend told you this that it’s true. It can be an emotional response, their anger or anything else talking. But no one on this earth is just made of black or white. We’re more complex than that. Yes you certainly have weaknesses. But you also have strengths.
When someone criticize you you can have healthy or unhealthy reactions. One would be for example to think that you are “the” problem. But it’s really harmful to think this. It’s always partial and things are more complex. But if you really think that your behavior is a problem - which is quite different - then you can still work on that. It’s not a fatality. We’re just humans. We have the right to make mistakes but we also need constructive criticism to better ourselves. Not just hateful judgments - which sounds to be the case with your friend.
I understand that it feels more comfortable to think that you’re the one at fault for everything and you’re the problem to everyone. It’s painful to even consider that you’ve got worth and value, that you have the right to exist. But still this truth remains. You have the right to exist and the right to be.
I hear you, I hear your pain through the different messages you posted on the forum. How you feel makes sense, totally, and no one wlll ever question that. But what you think about yourself, the conclusions you have from these situations isn’t right nor fair to you. And deep inside you know that.
Hold fast. You matter. Just because you are you.