Why do it if you know it's wrong

I know I'm gonna get a lot of bashing for this but idc. Yes I have insecurities issues, you get screwed over so many times you become insecure. But I called my boyfriend out on a few things that bothered me. He said he did talk to these people but nothing was to worry about. And I also called him out on the fact that he'd been liking this one girls pics. It wasn't just one pic it was at least 5 or more. It bothered me because he's always said that that wasn't okay. But yet when I called him out on it he sat there and said he knows it was a no go and that he's wrong for doing it. But why do it in the fucking first place then. He knows I'm insecure and knows about my past and that this past week I've been extra emotional for what reason I don't even know. But a lot has been bothering me and I'm just scared of losing him and then this just made me feel so much more insecure about myself.