PC deaths are painful both for the players, who have invested in a character, and for DMs, who have invested in ongoing story arcs and a narrative that made the characters protagonists in the story being created.
Deaths in the ideal should never occur from a single bad roll, however, in practice this ideal is almost impossible to obtain if there is any risk in a game at all. D&D goes about as far as you can go toward death never occurring as the result of a single bad roll without giving the PC's plot immunity.
Hit points are as a mechanic designed to prevent deaths from occuring as a result of luck. They provide ablative protection that usually must be blown through before the character is at risk of death, and they leave the character under no penalty until the character is actually at death's door. This means that D&D doesn't have the death spiral associated with more 'realistic' games where injuries really matter. Combined with high AC, hit points act to fulfill the goal of providing a "chance to escape from the situation before you "accumulate" enough bad rolls" and "death must always...result from player's own stupidity".
The traditional objection to D&D's system therefore lies in the 'saving throw', which from the beginning, allowed for all varieties of 'make a single lucky die throw or die' to occur. However, a careful look at D&D's orginal design will show several things to be true:
1) Wheneever a new challenge was presented of the 'save or die' variaty, at roughly the same point a mechanic was introduced that would provide a 'get out of jail free' card. Poison was the most common 'save or die' cause, and 1e's 'Neutralize Poison' was available early in a career and could actually reverse death from poison, neutralizing the poison and the bad luck. By the time 'save or die' mechanics were common, the party was expected to have access to 'Raise Dead', which would largely mitigate most bad rolling. In short, the game expected a party to have a limited number of resources that when spent wisely largely negated bad luck.
2) Since the difficulty of saving throws was fixed, the longer you invested in the character the less likely it was that you'd die to a single roll. Combined with the increasing numbers of 'get out jail free' cards, this meant that as you became more invested in the character the string of bad luck or bad decisions required to kill the character tended to increase.
One of the problems that is easily identified in 3e by anyone who has had 1e experience is that 3e largely violated this design. Third edition 'Neutralize Poison' for example doesn't roll back the adverse effects of poisoning, but rather merely prevents future effects. Third edition saving throw difficulty tends to scale up exponentially with the linear increase in CR, resulting in a situation where, the higher you get in level the more likely it is that you fail saving throws except possibily in your 'good saves'. This meant high level 3e play was dominated by the necessity of providing yourself with a suite of immunities of various sorts, and additionally fighters found themselves no longer in the position of having across the board good saves. Additionally, 3e made official house rules regarding 'critical hits', which add an extra element of luck to the game that tends to favor the NPC's. All of this served to create an environment where one bad roll killed a character.
I think it was backlash against this design that prompted the extremely gamist design of 4e where in fact single bad rolls pretty much don't kill a character, and characters generally die only after an exhausting grind of extensive bad luck. But I think it is important to note that it is only if you go to a highly gamist design that you end up with this result. If your game is even a little simulationist at all, even if you run your game in something like 4e, you still are faced with an enormous number of 'common' situations where one bad roll or one bad decision means character death. For example, falling into deep or tempetuous waters while wearing heavy armor and not being particularly adept at swimming, results in a situation where that single falled balance check, reflex save, or what not can mean death. Death can effectively hinge on a single survival check if inexperienced characters take a boat out into open water and a storm is indicated. Any time 'falling from a great height relative to your level' is an option, death can be the result of one bad roll or one bad decision. In virtually every campaign, especially while the character level is low, there are NPCs around where one bad decision on the part of the character can cause death to hinge on either DM whim or a diplomacy 'save'. Low level characters that openly flout the law, insult or threaten the wrong persons, or simply go into the cave that has sign, 'Beware, sleeping dragon!', just because they are curious find that they face death simply by stacking the deck against themselves. Often, despite the DM's best efforts, its not clear to the players just how monumentally stupid that they are being especially when the player is used to having more or less plot protection learned either by playing video games where you can murder and rob half the town and in a half hour of real time have it all forgiven and forgotten or at a table where they enjoyed such a device.
At my own table, I still play a variaty of 3e (which I've dubbed 3.25, since it diverges from 3.0 rather than 3.5) and I've taken steps to ensure that bad luck doesn't kill PC's. A variaty of changes insure that saving throw DC's tend to increase linearly rather than exponentially, so that high level PC's only very rarely fail saves. Many spells which otherwise would be 'save or die', are altered to be 'save or dying' in my game and coup de grace while still tremendously lethal is not so automatic in its death dealing. Additionally, I've added a sparing number of 'destiny points' to the rules, which provide luck mitigation through cancelling of critical hits, the provision of rerolls on failed throws, and a variaty of other sorts benefits which have the net effect of giving players a limited number of expendable resources with the net effect of partial plot protection while they last. Additionally, I have explicit rules for a third layer of last resort plot protection in the form of divine intervention, where a player has a rather low but still meaningful chance of recieving the protection of his deity in the face of mortal danger. In two years of play, it has happened three times (roughly once every dozen sessions). In short, I've done my best to make players never have to face death from bad luck without recourse to several options. But it still happens, particularly when the party is divided and players are left to only their own resources.