Army Pfc. Bradley Manning rightly faces many years in prison for multiple violations of national security law, including espionage. Far from his pose as a civic-minded hero who enlightened the world about the flaws in America’s wars, a military court has found that he betrayed his sworn promises and willfully broke the law.

Evidence in the trial suggests that he engaged in acts harmful to the nation out of little more than a desire for attention, self-pity and resentment that he risked expulsion from the Army because he is a homosexual.

Manning can thank a considerate judge that he was not convicted of aiding the enemy by his irresponsible decision to give more than 700,000 classified documents to the avowedly anti-American organization Wikileaks. After all, the reports he provided on Afghanistan were found on Osama bin Laden’s computer, an outcome he could reasonably have anticipated given his training in handling classified information as an intelligence analyst and his service in Iraq.

The judge, Army Col. Denise Lind, did not explain her decision to acquit Manning of aiding the enemy. But the fact that he did not directly convey the material to an agent of al-Qaida and the defense argument that he didn’t realize how it might help al-Qaida might have played a role. The judge may also have considered the charge excessive given the large number of other charges on which she found him guilty.

In pleading guilty to several minor charges last winter, Pfc. Manning declared that he had acted to make Americans aware of the “true cost” of the war.

But the major damage from his disclosures had nothing to do with the wars in Iraq and Afghanistan. The heaviest burden of his betrayal fell on American diplomacy. In giving Wikileaks hundreds of thousands of classified diplomatic cables that it gleefully made public, he created more than a lingering embarrassment for the U.S. State Department.

The government claims that the exposures cut off a number of confidential sources of valuable information. It has been estimated that spies would have paid over $3 million for the information contained in the Manning files.

In his plea bargain Manning hoped to limit his jail time to no more than 16 years. But the other charges on which he was convicted carry a cumulative sentence of 136 years.

Col. Lind will decide how long that prison term will be. Pfc. Manning’s costly betrayal of his country warrants a stiff sentence.