It's really two completely different things for hero's and villains. For hero's, it's more about showing their "compassion" or "moral code" as Sculli said. For villains, it's just silly writing.
For better or for worst, if you have a protagonist that kills, that can change the way the audience has to view the character and even the entire tone of the work as a whole. It's like, "instant anti-hero". If that's not what the writer wants than it makes sense for them to write around the main character killing.
Villains not killing the hero right away and setting up intricate death traps and stuff does irk me, but they are completely different things. Villains are usually evil so when they set up these traps, it's just a stupid way for writers to give hero's an easy way out, or to drag the story out, or two gives the villain a chance to explain his plans, make them seem more "diabolical", etc.
If Batman kills every thug and nemesis, it might be more "practical" in the real world, but it does change his character quite a bit.
A bond villain who has captured Bond, and decides to put him in some room with a gas trap or something, is just pure stupidity and should always be avoided assuming that the villain doesn't have some other justifiable reason for not killing.