A good villain is driven by the same drives as any other human is, just lacking a sense of judgement. For example, let’s use Mother Gothel from Tangled. She grows to genuinely care about Rapunzel, but doesn’t want to grow old and die. If she had been able to come to an understanding that would give Rapunzel more freedom but still provide the magic needed to sustain Gothel’s life, the main conflict wouldn’t have happened.
Dr. Horrible wants to rule the world and fix all of its problems, and impress the girl he has a crush on while he’s at it. Captain Hammer literally cannot feel pain and thus doesn’t have any capacity for empathy with the people he’s beating up. Both do some mildly evil things, but it’s all basically a game of one-upmanship. Things only escalate out of control when Captain Hammer makes it clear to Dr. Horrible that he’s only dating Horrible’s crush to make Horrible jealous, which pisses him off enough to bring a Death Ray to their next meeting, to end things once and for all.
On the other hand, we have Senator Palpatine from Star Wars, who wants to take over the galaxy (but why?) and exterminate the Jedi (but why?) and brutally suppress rebellion and dissent (but why?!). Palpatine does these things because he’s evil, and those are the things that evil people do. We’re not given any more insight into his motives.
Similarly, Voldemort from Harry Potter. His desire to live forever is understandable, but why the Death Eaters? (The fanfic Harry Potter and the Methods of Rationality had an intriguing answer to this question, but it’s not canon, obvs.)
A good villain is the difference between a good story and a great story, and there are far too few of them out there.