There is an exception to every rule. (Melina Mara/THE WASHINGTON POST )

5. We all will make mistakes. The key is to recognize them and admit them, to learn from them, and to take off the rear­ view mirrors — drive on and avoid making them again.” — General David Petraeus’ Rules for Living, as told to Paula Broadwell

These words are striking in context of what happened Friday, when General David Petraeus resigned as director of the CIA, citing an extramarital affair. Slate’s Fred Kaplan reports that the woman in question was his biographer Paula Broadwell. She is now under investigation for trying to access his e-mail.

Talk about mistakes. Talk about exceptions.

Ever since Eve lost her clearance to Eden, sex has been obliging people to leave secure and enviable positions. Helen had an extramarital affair and got stuck in Troy for 10 years. Lancelot never got his hands on the Holy Grail because of his protracted affair. Guinevere very nearly was burned at the stake on account of hers. That is usually how it goes. Guinevere bears the brunt of the gossip.

The simplest way out of this mess might be to end sex altogether. All it ever seems to do is get public officials fired whenever they are unlucky enough to have it with someone to whom they are not married. It ruins your clearance. It even inspires people to try checking your e-mail (admittedly, a jerk move from a relationship perspective) and then they wind up under government investigation. It is, generally speaking, a mess.

Besides, most of the country does not seem to have any at all, or they would not be so indignant all the time.

So, end sex. Marital sex, extramarital sex – chuck it all under the bus, so we can focus on our jobs. No more compromised positions. There ought to be a law! It’s certainly an elegant solution.

But sex remains unaccountably popular, in spite of what we know of its consequences. Millennia of experience have not convinced us. I cannot hope to sway anyone now.

Besides, there’s more to this mistake than sex. This is not another sacrifice to the Unappeasable They, the theoretical America that is always so bitterly disappointed any time word gets out that a public figure has been having sex of any kind, the Wagging Finger Somewhere In Iowa that will not rest until his career is placed on the altar.

These days, it’s never the affair itself. It’s the embarrassment. Anthony Weiner could have stayed in office if his incident hadn’t been so aptly named and taken up so much of the public mind.

And the Petraeus affair isn’t about our stringent public morality.  In this case, the news of the affair and the resignation came simultaneously. There wasn’t time for an outcry of the usual sort. Besides, public indignation varies as circumstances do. John Edwards will never work in this town again, while the only thing keeping Bill Clinton from a third term is the Constitution.

This is about mistakes — and exceptions. Who gets to make them? Petraeus has been an exception from the beginning. He was and is a truly exceptional general — beloved by the public, admired even by the media, and, more importantly, successful at his most critical responsibility. Great men can be failures as people. This does not make their deeds less great. The Declaration of Independence holds up, no matter what Thomas Jefferson got up to in his spare time.

People who are not succeeding at the task of being good humans can do remarkable things nonetheless. The task of being a good human requires entirely different skills. There’s a case to be made, often, that the two don’t overlap.

But this is the CIA. So everything overlaps.

This is a tangle given the demands of the Silent Service, where clearance is deservedly hard to get and an affair is a serious liability. Never mind what James Bond’s conduct would suggest. Nobody’s perfect, but this is one job where private conduct counts directly. There are always exceptions — in wartime, the only people with certain vital skills can win clearance even with serious liabilities, because the only unthinkable scenario would be not having them on your team at all. There are rules and there are exceptions. There are always factors to be weighed. But who gets to decide?

After all, you are always the exception. When someone else does it, it’s a sin. When you do it, it’s a mistake. Humans, as a species, are prone to mistakes. And we are equally prone to excuses. The difference between mortal and venial sins is that venial contains an I.

To quote Petraeus: We all will make mistakes. The trick is to drive on and avoid making them again. It takes leadership to determine when an exception should be made. And it takes leadership to acknowledge when an exception should not be made. It’s easy to see why President Obama reportedly agonized over this resignation for 24 hours. This is a difficult call. Frankly, it would be simpler just to end sex. That’s a fair less messy question.