People like a character they can relate to. And nobody can related to the kid who has the most toys, the best GPA, and is good at everything on the first try.
If you want your audience to relate to your protagonist, it almost goes without saying that the character needs to be flawed in one way or another. Whatever you pick, whether it’s a dark past, an extreme phobia, a drinking problem, or a bad haircut, your main character needs to have something–anything–that shows the reader that he isn’t perfect, because nobody likes Superman (unless, of course, it’s the real Superman, then that’s okay.)
One thing we all need to watch out for, however, when we create that character flaw is that it isn’t one that alienates the character from the audience. He can be a scumbag, sure, but he needs to be a scumbag we can relate to in some way. If you want the main character to be “bad”, give him a temper. Make him a bank robber. But give him a heart, too, so you don’t risk losing your readers. Everybody loves Robin Hood, even though he was, in essence, the mastermind behind a criminal enterprise. (You’re laughing, but it’s true.)
The other kind of character flaw to avoid is more of a stylistic approach. Don’t beat your reader over the head with the character’s flaw. Say the protagonist struggles with low self esteem. That’s fine, but if he is questioning himself seven times on every page, it’s not longer a flaw, it’s an irritating plot device that will turn off your reader. If he’s a pervert, that’s fine too (as long as it’s not too creepy), but if you have him looking up dresses in every single scene, it’s a waste of time (unless you’re writing a story which is about nothing else but a guy looking up dresses, which would just make you weird.)
In other words, keep it subtle.
The worst kind of character flaw isn’t really related to the character’s traits at all. This one falls entirely on the writer and the writer’s style. It’s when you simply do a poor job making the character important to the reader. This could mean that either the character is boring or the plot is just too dull.
The most important thing a writer of genre fiction needs to do is make the reader care about the main character. If he fails to do that, no specific character trait or flaw can fix it. The story itself needs to be rewritten in a way that makes the protagonist matter.
If you can’t do that, you lose the reader.
What character flaws have worked for you so far, both as a reader and a writer?