Cut off one`s nose to spite one`s face

To make things worse for oneself because you are angry at someone else. To hurt yourself in an attempt to hurt someone else.

The man is cutting off his nose to spite his face. Taking revenge on his neighbor will only cause him more problems.