I've been trying to remember a particular term for years, which I read in a journal once many years ago, but regardless of what I do... I can't. The only way I can describe it is "reverse altruism".
We all know what altruism is: we willingly do something that may cost or disadvantage ourselves, just so another being can thrive, giving money to charity. In politics, this may translate to voting for policies that disadvantage us personally, but is 'for the greater good'.
Whatever this term was, it described a scenario whereby people chose to do something that disadvantaged them, but they chose to do it because it disadvantaged others, too.
There's a lot of hate and desperation involved in this scenario. At the extreme end, you can find a suicide bomber (they die, but they hope to kill others, too). The article mentioned a less extreme example, where someone at the very bottom of society who disliked everyone above them, if given the chance, may choose to do something that may harm them if this moves the people 'above them'' a few pegs down. I think some of this did happen during the referendum.