I recently finished The Last of Us 2. I found the game to be a lot better than the Last of Us 1, and the story was a surprisingly mature dissection of hatred and othering. At least, that is what I took from it. You can agree or disagree, but to me The Last of Us 2 through both Abby and Ellie (the two main characters) shows us how hatred can take over our lives, cost us all the things we once held sacred, and how - ultimately - empathy is the solution to hate, but also very frequently one of the first victims of hatred.
For anyone looking to have this in your games, it is important to understand the basics of this. Both so you can add those "moral shades of gray" and layers of nuance to villains to make them seem more complex, but also - and perhaps more importantly - so you can avoid doing that in places where perhaps it is no appropriate. Sometimes people don't want moral complexity, endless shades of gray, and depths of nuance to their gameplay. Sometimes they just want a straight up villain they can hate and fight against. Sometimes we need the control of an evil that can be punched in the face to make things right. And when players are looking for that, when the game is sold on that, you don't want to accidentally spike it with things that are counter to that.
The key to hatred in a lot of cases is 'othering' the person. This is easier to do with less contact, less nuance, or contact and nuance focused on how the person is different from those that hate them. This, throughout history, is most easily done through religious grounds but can be done along any lines as long as you have a clear delineation of an "in group" and an "out group." You see this along things such as "they're not like us" but also in projections of hate (they hate our freedom, anyone?) and just in general wrong doing.
With making someone an "other" you highlight why they are different and why they are a threat. And those are the things you focus on.
A Reflection of Self
Empathy on the other hand allows us to see ourselves in other people. For all the mockery in the "Why did you say Martha?" bit in Batman vs. Superman, what was being attempted there was in begging to save Martha, Superman made (unknowingly) Batman see himself in the man he was fighting. A person powerless to save his mom. In seeing that connection, and in seeing himself in Superman, he can see past all the othering he has done and instead see the person inside. It is still a poorly done scene, but that is what they were going for.
The same is true with people. If you can get someone to sit down with someone they claim to hate and have an honest conversation you start to see where things are similar. And once you can start showing someone where they are the same as someone else, and how they can view things from the perspective of the other, it becomes a lot harder (but not impossible) to hate on those grounds.
The Key to a Simple vs. Nuanced Villain
this boils down to the key to a simpler vs. more nuanced villain. The more you keep the villain the other, the easier they are to hate and the more morally simple the game you run can be. The more you add nuance and avenues to show how the villain is a reflection of who the PCs could be/are, the harder they can be to hate and the more morally complex things can be. Or at least the more tragic things can be.
A Line Too Far - a.k.a. Kick the Dog
The trope "Kick the dog" is done to show someone is truly heinous and villainous by having them kick a dog for no reason other than it being in the way or the delight of it. The concept applies to villains as well. It is possible for a villain to be a reflection of the heroes, but still be a villain because they've gone too far. Just because the road to get where the villain is can be understood, does not mean they can have redemption. It just makes them a bit more tragic because they went too far.
There is more to this discussion, but I am not sure I am ready or able to unpack it in a blog post. So for now I'm going to leave it with this. While it is simplified, just remember, the more nuanced something is - and the more understood those nuances are by your players - the harder it is to hate it. The more simple, the eaiser. And the same is true when you need a group of NPCs to hate another group of NPCs.