What a strange code of moral values United States' spies live by.
They can torture suspects with water-boarding and detain them for years without trial. They can terrorise the wild lands of Yemen, Afghanistan and Pakistan with deadly unmanned drone bombers and call it God's work.
But when the Federal Bureau of Investigation discovers the boss of the rival Central Intelligence Agency had an affair with his biographer, that's beyond the pale and out he goes, whimpering apologies as he leaves the building.
The only people who will be able to make sense of this warped moral barometer is the USA's great enemy, al- Qaeda. But even they will be scratching their heads over who has been punished - they prefer to stone their wicked women to death, not punish the chap.
Just a while back, General David Petraeus was being tipped as presidential hopeful Mitt Romney's running mate. He'd led the great surge in the final years of the invasion of Iraq, and was then sent to Afghanistan to try to clean up that mess. A year ago he left the military and was appointed head of the CIA.
Then last week, the sudden resignation, declaring "I showed extremely poor judgment by engaging in an extramarital affair. Such behaviour is unacceptable, both as a husband and as the leader of an organisation such as ours. This afternoon, the President graciously accepted my resignation."
Walking into the White House to take his leave, you wonder if he paused to consider that he could be meeting the President in the very room in which, not so long ago, former President Clinton claimed not to have had "sexual relations" with "that woman" - his young intern - and survived the scandal.
It was home also to Marilyn Monroe's alleged paramour, John Kennedy, and to the World War II war leader, General Dwight Eisenhower, who reportedly found solace during the war's quieter moments with his driver - a woman, I hasten to add.
Perhaps Petraeus' unforgivable sin was to have sex with a writer. It's true we are a gabby, leaky lot. But the spies have delved into the records and discovered Dr Paula Broadwell wasn't a Red in the bed. The worst they can pin on her was that she went through the ex-general's address book and fired off a threatening broadside or two on his Gmail account to someone she considered a rival in love.
ABC News says sources close to the four-star general say the relationship wasn't consummated until after he retired from the military in August 2011. But obviously sparks were flying beforehand.
Both West Point military academy graduates, the general and Paula Broadwell met in 2006 at Harvard Kennedy School of Government where she was studying for her master's degree. They were soon emailing each other on a mutual interest - counterinsurgency and counterterrorism. In 2008 she began a doctoral thesis on "General Petraeus' leadership".
In June 2010 after he was given command in Afghanistan, Broadwell decided to turn the thesis into a book and was invited by Petraeus to Kabul to be an "embedded" observer for several months of Petraeus and his team.
War correspondent Michael Hastings called the eventual book a work of "fawning fan fiction," in his Rolling Stone review, dismissing it as "such blatant, unabashed propaganda, it's as if the general has given up pretending there's a difference between the press and his own public relations team."
But obviously hagiography was what the general wanted.
As for Dr Broadwell, she got her thesis, a doctorate and a book published.
At the entrance to CIA headquarters in Washington, the biblical quote, "Ye shall know the truth and the truth shall make you free," is engraved on the wall. It's a prediction that seems to have come true for the former director. He's now free to undertake the ritual penance disgraced US leaders put themselves through.
Meanwhile, the CIA can assert its moral rectitude and continue its drone attacks on innocent civilians and suspect terrorists alike.
In September, New York-based Humans Rights Watch produced a report, "Delivered into Enemy Hands: US-led Abuse and Rendition of Opponents to Gaddafi's Libya", based on Libyan intelligence documents seized following the dictator's fall. It accuses the US of covering up the extent of water-boarding at secret CIA prisons of opponents of Gaddafi before the CIA handed them over to the dictator's secret police.
There are also claims that US and British spies illegally detained and "rendered" opponents of Gaddafi back to Libya, to disappear into his cells.
But no one in America falls on their sword over these revelations. These excesses are acceptable. But a bit of hanky panky with your biographer, oh no, that was a step too far.