I want to spill a secret that my ex told me in confidence just to spite him.
Why do you want to spite your boyfriend? Did he do something?
He was really friendly and thoughtful however, he has recently made me very angry (he dumped me to go out with other girls)
You shouldn't tell someone else's secrets. Even if your boyfriend treated you unfairly, you shouldn't stoop to his behavior. People will view you as untrustworthy.
He deserves it! I don't care what happens to me anymore.
You should care about your reputation here. If people find out that you spill secrets when you get mad, they will stop telling you secrets and trusting you.