I got into a discussion the other night with a new acquaintance about the role of the villain in a story. His take was that a story's only as good as its villain, and in particular he cited a story where the villains turn into grudging allies against a greater danger. I disagreed: not every story needs a villain to begin with, and of those that do, I actually found the example he cited to be more interesting than the usual sort of villain for whom death means the solution to all the story's problems.
Is a story only as good as its villain? Sure, if you're dealing with the sort of story that is constructed to feature a villain in the first place. A story needs obstacles that are to be overcome, and sometimes those obstacles take the form of another person, but a villain is only required for a story inasmuch as it gives us something for the protagonist to confront.
I'm most interested in villains who on closer inspection turn out simply to be the heroes of their own stories, or fragile underneath, for totally coherent reasons. Blade Runner's Roy Baty is sinister on first viewing, but on closer inspection he's more desperate and frustrated than anything else. He does do terrible things — he kills everyone who blocks him in his quest for more life — but in the end he realizes a single good death is worth a hundred bad lifetimes. This is far more fascinating to me than someone who simply spits in the bad guy's face and twirls his Snidely J. Whiplash mustache.
The morality play used in most fiction—kill the bad guy, make everything perfect forever—is something we respond to instinctually, but not for noble reasons. It flatters us. It tells us things can be made better in a way that history shows to be the gross exception and not the general rule. These by themselves are not evil things, because life without mythology and hope becomes that much closer to mere existence. What makes them problematic is when we teach them to ourselves again and again without questioning them, without reflecting on the limitations of what we're being told, and without investigating to find out what else might be possible.