Games from before 1998 or so shouldn't really count, because nobody back then expected games to have a plot worth wiping your butt with anyway. So the princess is in another castle, whatever, as long as you get your highscore nobody cares.
For recent games that actually pride themselves on their writing, I'd say Fallout 3 and Kotor 2 rank high up in the shittiness scale. Fallout 3 because it's just that much of a dick move to have the game end with an "Oops, you died, sucks to be you" message, Kotor 2 simply because the devs ran face first into the deadline and it's just a huge letdown in general, even compared to the rest of the game.
Actually, thinking about it, all games that end in the player character dying due to cutscene stupidity syndrome count for this, especially in RPGs. So you're this hugely powerful, superbuff hero who can kill archdemons by farting in their general direction, but you still die at the end because the writers wanted to go for the "mature" angle, with mature meaning "contrived drama?" Fuck that, seriously.