Likewise, a story in which every character, including deliberately shady side-characters like Garak, are supposed to be flawless epitomes of virtues and idealism. But he's witty and engaging and adds spice and character to the proceedings -- as supporting characters should. He's not the hero, he's not the villain, but he keeps us guessing, which is good storytelling.
Casablanca is both a wonderful movie and a great example. It's a movie about flawed people, warts and all, in a high-pressure environment, faced with difficult choices. And much of its power comes from the way it keeps us guessing, right up to the end, which way each character will fall. Do you collaborate with the Nazis, or do you just keep your head down and try to stay out of trouble, or do you join the Resistance? How will far will Ilsa go to save Viktor? How far will Rick go to get her back, if he can even forgive her for breaking his heart years ago? Will the charmingly cynical Captain Renault (who gets soo many good lines) finally do the right thing in the end -- or is he too busy trying seduce other men's wives?
Can't imagine the movie would still be a classic (and highly recommended) if everybody -- including Peter Lorre and Claude Rains -- instinctively did the honorable thing right from the start.
Which to be clear does not mean the movie is just pure entertainment, devoid of idealism (although it is fabulously entertaining, packed with great characters and sparkling dialogue). To the contrary, it's very much a morality play about flesh-and-blood people facing crises of conscience.
"The human heart in conflict with itself," as Faulker famously put it.
(At the risk of getting all English-litty.)