The context:
Someone wishes to punish somebody, and the wish is so strong that whatever they think will do a lot of harm to the one planned to be punished, they do it obviously at the expense of their own welfare, much higher than the prognosticated result of the punishment.
For example, in Russia, famous for its frosty winter, there's a saying which may be translated into English as "To spite my mom I'll frostbite my ears".
Is there an English idiom, maybe a couple or so idiomatic expressions, exactly or approximately matching the above-mentioned Russian saying?