There are a lot of reasons for things like this happening, but I tend to blame stupid writers. It's not easy to make a character who is smarter than you, so purportedly smart people can make dumb decisions simply because the author didn't think things through.
What irritates me the most about these kinds of shows is how popular they become. People love to see smart characters being nerds, especially with the current popularity of geek chic. But it also seems like they love seeing nerds screwing up, like it's a catharsis to see "superior" people being even dumber than the viewer is. It comforts us to see that intelligence is just a facade. The problem is that it is a false stereotype. Smart people are smart. They are humans, and fallible, but by and large, they aren't stupid and they don't do the same stupid things week after week without learning.
I recognize that stories need drama, and that if somebody was smart enough to avoid trouble, then they would be more boring. Still, I don't think it's a valid excuse. If you're afraid a smart character would solve problems too easily, then don't write smart characters.