Why does my ex boyfriend call me ugly in front of me?

My ex boyfriend and I didn't have the most amicable breakup, but we're kind of friends now. Were in the same friendgroup. But whenever someone compliments my looks in front of him, he has to jump in and say I'm ugly. This girl I just met was saying to our group of friends the other day that I'm "really beautiful" and my ex jumped in and was like "eh, she's not all that. My new girlfriend is better." Why does he feel the need to voice these things out loud? Idc about him but it's embarrassing that he says that in front of other people.
Why does my ex boyfriend call me ugly in front of me?
Post Opinion