When I create a villain, I try to avoid themes that make my players physically uncomfortable. So no sexual violence or torture. Instead I try to get them emotionally invested, as
@Bawylie just said. I try to get them angry about an injustice that the villain committed against innocent people.
For example: I had a ruthless pirate captain, who threatened a local baron with severing the arm of his young daughter, if he did not tell him where the townsfolk were hiding. The players met this armless daughter, now a baroness, and learned how she lost her arm. And this made them hate the villain so much, that they would do anything to catch him alive and bring him before her. They wanted to see justice served to him, despite it being but a footnote in the story really. Making the players care on such a powerful level is key I think.
But I think you also need to be able to follow this up with a satisfying ending. How does the villain end up paying for his crimes? Does he simply die in combat, or are the players given a chance to choose a fitting punishment for him? A strong pay off is key to any effective villain. And also with the pay off I tend to lean more towards poetic justice and not towards gore and torture.
In the case of the pirate captain, the players allowed the baroness to pick his punishment. She ended up telling the pirate captain what happened on the day he took her arm. She told him how her father had hidden the townsfolk away in the local well, where they would wait in absolute terror as he and his men ravaged the town. And then she told him that he and his men would spend the rest of their lives in that same well, with no food or water, and no one would ever hear about them again. The baroness understood that the reason the villain was to cruel, was that he wanted to be known and feared. So what better punishment to leave him to rot in that same well, and have him be forgotten completely?
I like my villains to be memorable, and for my players to be able to recall them for years to come. I want them to remember the crimes of the villain, and how they ultimately met their end. This can be poetic justice, or a hilarious death, or tragic. But it has to be memorable.