In my humble opinion, a good Dungeonmaster knows that he or she is creating a world and the PC's are a vital part of that world.
I have never had a problem killing off any character. In fact, some could say I was ruthless at times.
Sure, there were traps that decapitated, poisons that killed instantly and deadly attacks that allowed no saving throws.
Used sparingly and creatively, these things will keep players thinking constantly. Which is a good thing.
Even with these grim situations present, I almost never put the PCs in an inescapable situation.
One particular fiendish trap was a cursed scroll that when read, "gated" or teleported the PC to another room in the dungeon. They arrived in a suit of armor that was lined inside with hundreds of spikes much like an Iron Maiden. This did not kill instantly but caused a slow, agonizing death at 1-2 hit points per turn. What was "supposed" to happen, is the loot happy adventurers would most likely examine the scroll immediately. (Like ALL cursed scrolls, the effects are instantaneous.) The unfortunate victim would be heard shrieking from a nearby room, the rest of the party would come to the rescue and pry the poor wretch from the deadly trap.
However, due to a lack of foresight on my part, the party returned to town before they sifted through all their goodies.
Suddenly, one of the adventurers was no longer swilling ale with the rest of the victorious heroes and had vanished in a smokeless "poof" from the tavern.
Being a generous Dungeonmaster, I dropped enough hints that the victim might have been taken back from the trap infested dungeon they had recently explored and overcome.
Unfortunately, they didn't make it back in time since they had to ride through a blizzard.
On top of all this, they couldn't leave the ruined keep with their deceased pincushion since it had been surrounded by evil looking men in black, cowled robes hurling searing bolts of eldritch flame. This was where I concluded the adventure.
(Originally, that was supposed to take place in a dramatic attack upon the inn back in the village in which the PC's were sorting their booty because they had found an item these bad guys really wanted. But I adapted.)
Now all this sounds bad.
However, what I would like to point out is the fact that there are far worse things you can do as a Dungeonmaster.
My good friend and fellow Foaming Flagon will agree with me.
Taking a beloved character from first level nothing up to 8th, 9th or 10th level badass is a wonderful and rewarding achievement. An achievement that I shared in as a Dungeonmaster with all my players. (Well....ALMOST all of them.)
You can't be human and not feel that sympathy with a good player and a great character.
Then that character fights a wight, a vampire or some other level-draining beast.
You HATE to see it!
Even as a DM because you had a great adventure planned for the next weekend!! But now that the 10th level hero is now a 4th level bitch, you don't think they could make it.
(And if you are being fair, you would be right.)
I remember when my good friend acquired a sword from a published adventure that I ran which I thought fit his character perfectly! It was an amazing blade that drained levels/energy from the creatures that it hit.
Unless they were undead.
Then it worked in reverse.
After a couple of really good hits on a vampire that should have nearly vanquished the foul undead, I had to inform the player that they had just lost 4 levels of experience.
(Remember, the hit points, spells, special abilities and everything goes with that.)
My friend was devastated. So much so that he hurled the blade away intent on never using it again.
(This is an AMAZING player here folks!)
I had to convince him the blade itself was not bad. (Reminds me of a really good book.)
I just hated to see him lose such a powerful item. He just had to make sure he carried a spare weapon that he used for undead.
You see, with death, resurrection is almost always possible. Unless your paladin hurtles down a greased chute, cursing his God(s) and plunges into a river of molten lava. That pretty much puts a finale on anyone.
But when your levels are drained. (Vampires in the old AD&D system drain two levels every time they pimp slap you in your miserable suck.)
Do that over 3 rounds of combat and you suddenly need an 18 on the dice to even hit the fanged fiend.
Good luck winning that fight now.
Then of course, it's much tougher to adventure with the rest of the party who are still at a significantly higher level. In order to keep things fair and fun, you have to continue providing challenging beasts, traps and other encounters. Things that may (and should) be more than the lower level, former hero/leader of the adventuring group can realistically handle.
Yes. It can be done. But you just don't get as many experience points hiding behind the crates and boxes in the Illithid smuggler's lair or lurking outside the den of the dragon while everyone else goes in and fights. (And gets slaughtered.)
And face it. Unless the character was a sneaky little spit of a thief or a quivering magic-user that buggered every boy apprentice he ever had, the player starts feeling left out.
(No one I remember ever played a pederastic magic-user, but it would have been hilarious!)
It makes for complexities in a DM's campaign writing that can prove to be extremely difficult to deal with.....interesting at times; yes....but difficult.
Additionally, any catastrophe that befalls a hero that permanently disfigures them, lowers a stat point or otherwise alters them forever can also be entertaining. If you have a good player, it can be loads of fun and will be seen as a chance to develop the character and not just toss them in the waste basket or the "retired" file of character sheets.
But the player has to be good.
If the player is a dick, there's a good chance they'll just start crying.
But NO ONE likes it when they get their hard-earned levels kicked in the nuts!