One fun thing about the masterminds is that they so rarely get pummeled into submission and dragged ignominously away in abject defeat to spend time in jail.
Of course Doom abuses diplomatic immunity, robots who pretend to be him, and, in extremis, the ability to switch his mind into another body, to avoid overly humiliating defeats, or getting hauled away in handcuffs, so that's cheating...
Doom also has a code of sorts, which makes him far more compelling a character than Luthor.
Attempts to ape that success by giving characters like Magneto or Venom or Bane or Captain Cold or Catman a code or personal honor or some sort of principles has met with some success as well. (Although it runs the risk of cheapening the notion if it goes too crazy. Some villains should remain just flat out bad-guys.)
I feel that the villains with some sort of character development or depth, unlike, say Doomsday or Holocaust or other big dumb elemental forces of destruction, are always going to be more compelling, and it's the geniuses and masterminds that spend the most time talking about their plans and goals and motivations, giving us a chance to get to know, and perhaps even appreciate, them.
My favorites are the lovable losers, the ones that are just such jobbers that you have to feel bad for them. Just as Spider-Man tends to be a hard-luck hero, for whom life tends to pile it on, making you feel bad for the guy, some of the super-villains also have that sort of vibe, like the Beetle (now Mach V) or half of Magneto's Acolytes or the League of Super-Assassins (who, despite their name, have pretty much failed at their task, to kill the Legion, and remain perpetual losers).
Every villain is going to lose in the end, but there are some that you just know right from the start aren't going to go anywhere. Mutant Force or Trident or the Force of July (not really villains, but still adversaries of the heroes).