To me, the most egregiously overlooked aspect of gaming is humor. Funny games are a rarity; games that attempt humor and miserably fail are a bit more common. Still, typically the only attempt at humor in any game is an easter egg or reference to something funny that already exists outside the game. Yet, for something so neglected, humor is one of the most effective writing tools available to designers.
I think there are two basic reasons why humor gets so little respect:
A) Writing humor is surprisingly difficult. A little quip now and then isn't too hard, but consistent humor is. There are only a handful of real humor games, humor books are extremely difficult to do well (this is why most break the material up into small chapters that aren't related to one another—that's easier), and comedy movies have a huge failure rate. It's a tough subject. Yet, for some reason, people tend to view humor as much easier than it actually is.
B) Writers are afraid that humor will undermine the rest of the story. This is a legitimate concern; badly done humor can kill the seriousness of the subject matter as well as pulling people out of the world, and it's easy to fuck up humor. On the other hand, well-done humor can actually enhance both of these. The paper shortage joke in Battlestar Galactica was probably the funniest part of that dark, ultra-serious series, but I bet all of you remembered it verbatim when I mentioned it.
This topic came to me because of, surprise surprise, Mass Effect 2. It's a very funny game, much more so than its predecessor, even though the subject material is quite dark for Bioware. And I think it shows the main reason humor can be so effective: it makes characters better.
This is exploiting a basic psychological phenomenon. We automatically like people who make us smile and laugh more than we would otherwise. It's the difference between the guy you know who's just a dick and the one who's a lovable rogue. Both of them can be bitter assholes, but the one who's a bitter asshole in a funny way will be likable in spite of it.
Other genres have understood this for a long time. Mal Reynolds in Firefly comes to mind—if you look at his character objectively, he's a terrible person. But he's funny about it, so everybody loves him. Meyer Landsman in The Yiddish Policemen's Union is the same way. These principles apply to games just as easily, making the player remember the character and empathize.
Let's go back to Mass Effect 2. The consensus I've seen is that the cast is strong all-around, but everyone's favorite character is Mordin. Purely on character merit, he's a good choice. He's a Salarian scientist and commando with plenty of depth, backstory, complex motivations, unclear morality, all the good stuff. That alone would make him a solid character, but Bioware also made him the funniest party member, elevating him above the rest in most people's minds. His combat shouts are funny, his dialogue is great, he makes quips at characters during other scenes, he has a few amazing bits where he's giving sexual advice or doing opera.
This isn't the first time Bioware's made a character stand out with humor. HK-47 is everyone's favorite from Knights of the Old Republic (and in KOTOR2, even though it's a much better game, HK-47 isn't as funny and people didn't like him as much). Baldur's Gate 2 had enough potential party members to have an entire comedy team—Korgan, Edwin, Jan Jansen, Minsc. Then there are the rarest of the rare, actual humor games. Anachronox is the shining example; a serious story, with excellent writing and character work, while also being the funniest game I've ever played. No one's ever mixed it as well.
By the way, if you've never played Anachronox you've missed out. Go find it.
The lesson in all this is developers should not be afraid of humor. If you can't do it well, then by all means leave it out—no humor is better than bad humor. But a little bit of it, used properly, can elevate any character and, by extension, the game as a whole.
There is one caveat: humor has to fit into the game. If you just throw in a joke that doesn't work in the setting, it will undermine the character and story. It takes some effort and care to craft humor that is as internally consistent as everything else in the game's story, but it's absolutely necessary to make it work. Writers should know this already, but if you've hit bad humor in a game that pulled you out of the experience, more than likely they were violating this rule.