WASHINGTON — The Army inspector general was unsparing: The two-star general had an inappropriate relationship with a woman and lied to investigators about it, made his staff buy sexy clothing for her, subjected his underlings to racist and sexist emails and allowed himself to be photographed with another woman licking the medals on his formal dress uniform.

After the report was received and signed by top Army officials in September 2010, Maj. Gen. John Custer, commander of the Army’s intelligence school at Fort Huachuca, Ariz., faced public shaming and the loss of rank.

That’s when Gen. Martin Dempsey intervened. Dempsey, then the four-star in charge of the Army’s Training and Doctrine Command, struck from the record the substantiated finding of Custer’s inappropriate relationship. That left the board of three generals deciding Custer’s fate with two relatively minor charges and the letter of reprimand that Dempsey had issued.

Custer's case, and Dempsey's intervention, were kept in the dark by the Army for years. The matter came to light only after a whistle-blower complained to USA TODAY, which then obtained the report through a Freedom of Information Act request. The military’s lack of transparency in meting out punishment allows favoritism to go unchecked, said Don Christensen, president of Protect Our Defenders.

“The discipline process is opaque. When it comes to generals, it’s a blackout,” said Christensen, the former top prosecutor for the Air Force. “You have to be lucky. Rarely ever does this sees the light of day. ... At the four-, three-, two-star level, they cover for each other. Dempsey by his actions proved it.”

The generals considering Custer's case could have busted their fellow general officer down to the last rank in which he had served satisfactorily.

Instead, Custer was treated to the pageantry of his change-of-command ceremony and a glowing story on the Army’s website, and he was allowed to keep his two stars in retirement and the six-figure pension attached to it. A two-star officer with his experience would receive about $162,000 per year in pension payments.

Dempsey, a little more than a year later, ascended to the top of the uniformed military: chairman of the Joint Chiefs of Staff. From that post, he would lament the ethical crisis in the military and the scourge of sexual assault and harassment. He and the chiefs vowed to root it out.

However, Dempsey fought attempts by Congress to limit the role of commanders in handling of sexual assault and harassment cases, saying in a June 2013 Senate Armed Services Committee hearing that "our goal should be to hold commanders more accountable, not render them less able to help us correct this crisis. The commander's responsibility to preserve order and discipline is essential to affecting change. They punish criminals and protect victims when and where no other jurisdiction is capable, or lawfully able to do so."

In the case of Custer, it was his commander, Dempsey, who wiped out the substantiated claims of adultery and never disclosed his aid to Custer while the bills were being debated in Congress. If senators had known, that might have altered the course of the legislation.

Stories in the last year by USA TODAY about the “swinging general,” Maj. Gen. David Haight, whose serial promiscuity killed his career, the demotion of the three-star adviser to the Defense secretary for drunken carousing at “gentleman’s clubs,” and the firing of another on the Joint Staff for adultery show that misconduct among senior officers has been anything but eradicated.

Even long-retired generals like Custer can be subject to sanction. Arthur Lichte, who retired in 2010 from the Air Force as a four-star general, lost two stars in February, and $60,000 a year in pension benefits, after it was determined that he had coerced a subordinate into sex.

And it largely remains a dirty secret within the military. The case of Haight, who had the critical job of overseeing operations at European Command, likely would have passed by unnoticed if not for a whistle-blower complaint to USA TODAY. The Army had quietly removed him from his post last spring, replaced him without notice and hauled him back to Washington. Even though he had been a candidate for blackmail and espionage, Haight had been allowed to maintain his security clearance until USA TODAY asked about it late in the fall.

Read more:

New details show how 'swinger' Army general's double life cost him his career

Strip clubs, alcohol derailed a general, inspector general's report shows

Joint Staff general's girlfriend problem grounds career

Air Force busts retired four-star general down two ranks for coerced sex