How do I move on when my boyfriend defended his friends over me?

My boyfriend has been justifying everything his friends did that was bad for longer than a year now, nearly 2 and every time it hurt me and I went to him for comfort he would make excuses for his friends like they're just stupid, or they didn't mean it, or it was just a joke or he didn't understand and I would feel delusional and not heard when everyone else around me is seeing exactly what I'm seeing and telling me that he isn't prioritizing me, I felt like he didn't have my back with anything. Just a few days ago we were arguing about something and he defended his friend instead of staying on the issue at hand. I got to the point of giving up and feeling helpless and I told him that If it doesn't change and he can't take my comfort seriously then I'm not going to be able to carry on. He has been trying his best to make things right recently and he says that the reason he did that was because he didn't want me to see his friends in a bad light and wanted us to have a good relationship regardless of what they did. I told him it feels like his friends image is more important to defend even when they are not in the room, even when they did inappropriate stuff than him being there for me when I'm not comfortable and hurt. He said he'll do better and that he hasn't been handling things the right way, that he knows he messed up, said he's willing to do whatever, he just does not know what. I get that because you can't really change the past but I can't get over this, it's affecting me so much that he chose to be there for his friends who messed up but not for me who reacted to what they did. I really don't wanna throw my relationship away over this though, is there any advice on how to go about this so that I can move on from this and not let it affect my relationship?

Tl;dr: How to move on from an issue that you can't get over but there's not much to do but do better the next time and your partner feels remorse but does not know how to fix it or take it back?
How do I move on when my boyfriend defended his friends over me?
Post Opinion