Russia has reacted to sanctions from the West by banning imports from those Western countries. The action reminds me of today’s expression.
A snopes discussion offers Word Detective input: “it seems to have first appeared around 1200 as a Latin proverb cited by Peter of Blois, a French poet of the day.”
Another commenter says “According to Nigel Rees in A Word In Your Shell-Like: 6,000 Curious And Everyday Phrases Explained: The expression may have originated in 1593 when King Henry IV of France seemed willing to sacrifice the city of Paris because of its citizen’s objections to his being monarch. One of his own men had the temerity to suggest that destroying Paris would be like cutting off his nose to spite his face. The phrase seems not to have taken hold in English until the mid-19th Century.” Without a written reference by “one of his own men”, this may be apocryphal.
It’s nice when Snopes does your work for you.
Either way, the phrase refers to an act that injures you more than it injures your opponent. While this phrase labels such acts as foolish, sometimes harming ourselves makes sense if it will punish a cheater. I guess, for every rule-of-thumb on one hand, there’s the other hand.