Cut (one's) nose off to spite (one's) face proverb
To harm, hurt or cause problems to yourself when you are trying to do that to someone else.
Her intention was to poison John. However, she ended up cutting her nose off to spite her face when she drank the poisoned wine intended for him.
Mary insisted on the authorities investigating her political opponent on suspicion of tax evasion. Now it seems as though she had cut her nose off to spite her face, as the investigator dropped the tax fraud charges against her.
The verb "cut" must be conjugated according to its tense.
This may come from the story of a Viking attack on a monastery. The nuns in the monastery cut off their own noses so that they would not be attractive to their attackers.
People tend to like forbidden or illegal things just because they are forbidden or illegal.
He must have believed that stolen fruit is the sweetest, and he, therefore, cheated on his partner.