Jealousy thoughts

Why do our brains engage in jealousy thoughts? It’s neither pleasurable nor does it serve us. It seems like it should be easy to let go of them, but the thoughts keep popping up.
I am going to be diamond member next month, and if there is one thing I have learnt being a scholar is to look at my thoughts with curiosity and not judge myself.
I am curious why was I jealous when my coworker showed me pictures of his renovated house.
My thoughts were:
His house is fancier than mine
I thought my house was the nicest, but his looks better.
I spent more money than him on the house , so mine just be nicer.

These thoughts don’t serve me, but my brain convinces me that they are true. How do I work on them ?