I'll try to find the article, I think the point was that we think we are being violent to others with a conscious intention of trying to prevent future violence, but that most of the time we are doing it with the intention of them knowing our current pain that we think they caused to us, not really thinking much about the future.
So if the spite causes people to feel sufficiently afraid to do the action in the future, maybe it deters people from acting that way?