Don't cry over this guy. He has had a hell of a run. IMO someone "dropped a dime" on him with the FBI. Once that happened an investigation into the limits of his lover's access to classified information through her relationship with him was inevitable. The FBI has the power to investigate anyone in the US Government, including the director of the CIA, and they relish the responsibility. It is in the grand tradition of J. Edgar Hoover. A secondary consideration that is unappreciated by civilians is that as a retired US Army officer Petraeus is still subject to UCMJ and its prohibition of adultery, a crime under UCMJ punishable by a dishonorable discharge and a year in prison. It is unlikely that this would happen but it is still the law. If you don't like that, tell Congress to change the law.
Who would have "squealed" on him over his paramour? There are various candidates so far; her husband, someone at CIA who did not appreciate everything he did, someone or some group in the US Army.
He was never much liked in the Army. "Clever" is a term of art in the Army for someone "foxy," slippery and politically adroit. He was always clever. At West Point, which is, after all, a college like all others, the appreciation of teachers can be carefully cultivated by students. He excelled at that. Every WP graduate becomes an Army officer. Relationships established with officer staff there affect the rest of an officer's career. Petraeus married the daughter of the superintendant (president) of the place. This officer was a major general. Later he was a four star general. Throughout his career Petraeus carefully maneuvered to maximize his potential for promotion. He has a terrible reputation in the Army for egomania smoothly concealed beneath the appearance of the warrior scholar. He can and has charmed all, or almost all. His fluency in the English language and his ability to interact with congressmen and the press are superb.
He was not the originator of the armed forces current doctrine on COIN. He did not triumph in Iraq employing that doctrine. The improvement in the security situation there happened because he was clever enough to accept marine and Special Forces sponsorship of the "awakening" of the Sunni Arabs to the fact that they did not wish to live under Al-Qa'ida rule. This led to the creation of the "Sons of Iraq" who, for a time, virtually wiped out the Sunni jihadis. This gave the Shia Arab dominated government a chance to at least partially assert its power in some parts of the country. This serendipitous set of events was carefully parlayed in the US media into the creation of an image of Petraeus as the heir of George Marshall. Iraq is slowly becoming a satrapy of Iran. Should Petraeus have credit for that as well?
His success" in Iraq led to sending him to Afghanistan to apply the supposedly victorious doctrine of COIN there as well. We see the reult.
As I said, don't grieve for him. He had a long run and will now make a lot of money somehow. He is clever. pl