A good villain is not pure evil... they have reasons for doing that they do, reasons that to them make perfect sense, probably even seem "good" to them. And for that, you're able to relate to them, however distantly. For example, Mr. Sinister does awful things, but not for the sake of being awful. He does it because he values knowledge. Magneto does what he does to help mutants, not because he hates humans. And in the Spider-Man films, Harry Osbourne was just avenging his father.
A couple of weaker examples: Galactus destroys worlds not because he enjoys the destruction, but because he's hungry and he needs to survive somehow. Dr. Doom attacks the Fantastic Four not just because they're the good guys, but because he hates Reed with a passion. Mystique does villain-y things because she's trying to help mutants or specifically Rogue (like when she was willing to kill Hope in order to save Rogue.)