I can't really recall setting up PC deaths as a punishment. Though, I sometimes have the oddly malevolent giggle of putting something that is likely to kill a PC into a room. I mean, I know they are going to investigate the "item of doom", they are PC's right? But I'm not gunning for anyone in particular there, I'm just reminding them that being an adventurer is dangerous.
However, I kill NPC's for story reasons like I am eating candy. I have also prophesied the death of a PC from early on in the game and gone after the whole party at the end of a campaign. I'm actually thinking about writing that campaign up as a Story Hour just to get some practice. But, everyone is looking for examples, so I will give some.
PC: Ternell - Paladin of Pter. Good guy, low Int. Great player, who sometimes gets a little cocky.
Situation: Taking the PC down a notch & introducing a villian.
We had just finished up a decent Story Arc and I was starting to plan a new one. I remember being at my LGS and seeing the cover of a module that struck me as perfect for an NPC I had. I wish I could remember the name right now, but it was a girl in a dress with a bastard sword in the middle of an undead army, or that's how I remember seeing it.
Anyway, the party is coming back to their base city when they meet the local army riding down. It seems that an undead army is moving North and they are supposed to stop it. The PC's, being mostly good, offer to assist. The battle site is selected near a chapel of Pter. When the battle begins, the leader of the army lays out an idiotic battle plan that strings the army out in a long line with no mutual defense, no defense on the flanks, no hidden surprises, etc. (Yes, this was intentional on my part. The NPC was supposed to be less than brilliant.) Much chaos and death ensue up to the point where the PC's appear to be the last living combatants. They have used most of their spells, most of their turnings etc. They are on a low hill and surrounded when the undead stop fighting. Ranks part and a blond girl with a frilly white dress is walking up to the party. I believe I described her as 'cute as a button'. The PC cleric recognizes her as his long lost sister that he sometimes dreams about. She ridicules the party and calls out Ternell to single combat. She promises to 'kick his ass' and kiss him. She summons an imp to go get her a weapon.
Ternell wasn't too sure about this, but she promised to attack them all and kill them if he wouldn't come out to play. She also said a lot of disparaging things about him. He finally relented.
It was kind of a sad battle, she was buffed up the wazoo against him and had a 32 AC. She would literally dance around then attack once. The real insult came when she started striking for subdual. Ternell didn't even hit her once. It brought disbelief to his little 7th level face. She kissed him, knocked him down to the ground and then cut off his hand. The whole army left and she had the imp bring his hand along.
Storywise, it introduced a vilian that had some strong ties to the party. It also introduced a bunch of questions and the overreaching story arc for the campaign. The side affect of teaching the paladin PC that he wasn't quite as tough as he was starting to think was more a lesson that the PC's were not the top of the food chain at 7th level. It was fun for me and the players all enjoyed it, even Ternell's player.
PC: Ternell - High Knight of Pter (Homebrew PrC) Still a good guy with low Int. Player is still great and knows the campaign is ending. His prophecies are reaching culmination.
Situation: The party has to waken a slumbering god of Evil and Madness and evict it from the pseudo-dimenstional pocket that it sleeps in that ties it to the material plane and is basically the root of all Evil in the area. Ternell's god, Pter, has personally charged Ternell with making sure the god does not exit to the material plane. The evil god must leave by the other portal where Pter himself might have a chance to do battle with the god of evil.
I'm not going to go into all the details, but the battle was pretty grim. Even a tricked out PC is going to have a difficult time taking on a god. Ternell knew he was going to be sacrificing himself to, literally, save the world. He was OK with that, it's his job. The player knew it was coming up and was pretty sure Ternell would be dying. But, he had some hope that it might still work out so that Ternell could retire someday. I think the player had more hope than the PC did in-character. The battle was pretty much an effort to see how long the PC could hold off the god. Could the rest of the PC's seal the portal before Ternell died. It was close, but Ternell did not die for nothing.
Definitely an example of intentioanlly killing a PC.