Suppose a person is after something or somebody. For example, Tom wants to be with Jane, but somebody else wins her heart, and Tom says, “She was ugly/fat/... anyway.” Is there a word or idiom to describe Tom's reaction?
For a single word, I'd call that spiteful:
showing or caused by malice.
"the teachers made spiteful little jokes about me"
synonyms: malicious, mean, nasty, cruel, unkind, unfriendly, snide, hurtful, wounding, barbed, cutting, hateful, ill-natured, bitter, venomous, poisonous, acid, hostile, rancorous, malevolent, evil-intentioned, baleful, vindictive, vengeful, vitriolic, vicious, splenetic, malign, malignant, bilious; defamatory; informal bitchy, catty; literary malefic, maleficent
If you want to focus on motive rather than effect, then "jealous" as you said, or "wounded", or "lovelorn" and so on.