Editor's note: Gabriel Schoenfeld is a senior fellow at the Hudson Institute in Washington, D.C., a policy research center that describes itself as working to promote national and global security and freedom. He is the author of "Necessary Secrets: National Security, the Media and the Rule of Law," published by W.W. Norton in 2010, and "A Bad Day on the Romney Campaign: An Insider's Account" published earlier this year by Penguin. Follow Schoenfeld on Twitter: @gabeschoenfeld.

(CNN) -- For passing hundreds of thousands of secret U.S. government documents to WikiLeaks, Pfc. Bradley Manning has been found guilty of violating the Espionage Act, but he was acquitted on the most serious charge of "aiding the enemy," a capital offense. Has justice been done?

In some quarters in the United States the question remains a burning one, and even more so in Europe where a movement of supporters has been active in his defense, decrying the conditions under which he was imprisoned while awaiting trial in a Quantico brig, and generally arguing that Manning is a whistleblower who they believe has done nothing more than expose American wrongdoing in Iraq, Afghanistan and around the world.

It's true that for a period of time, Manning was held in less than humane conditions for reasons that have never been convincingly justified. And there is no question that some good came out his revelations. After all, some of the documents he revealed about Tunisia, Bahrain and Egypt may well have helped to ignite the initial hopeful phase of the Arab Spring.

More generally, it is hard to argue that we are not all better informed by our ability to pore through hundreds of thousands of documents detailing the inner workings of American foreign policy.

But such benefits are completely beside the point. The United States, like every country, depends to a significant degree on secrecy in conducting diplomacy and defending itself in a dangerous world. But we are also a democracy. Our procedures for determining what should be kept secret and what should not have been developed by institutions that, whatever their flaws, are under the people's control, funded and overseen by the people's representatives in Congress and directed by an elected president.

In a democracy, individual soldiers cannot be permitted to make decisions with such far-reaching consequences. When they do take such decisions into their own hands, they are trampling on the workings of a democracy and usurping a power that properly belongs to the American people.

This is something that Manning himself seemed to recognize when he pleaded guilty to a series of lesser charges earlier this year. Pressed by the judge on that occasion about how he reconciled his claim of doing something positive with his acknowledgment of wrongdoing, Manning explained, "Your honor, regardless of my opinion or my assessment of documents such as these, it's beyond my pay grade -- it's not my authority to make these decisions."

Manning was right. And he was also right on that occasion to accept the legal consequences of his actions. In that respect, he has been more consistent than many of his supporters, who have continued to profess his innocence and acclaim him as a hero even after Manning himself pleaded guilty and acknowledged serious wrongdoing.

Some of those same supporters, perhaps because their agenda is not really governmental transparency but blackening the name of the United States, are eager to ignore the high costs of Manning's actions. In a typical vein, one such supporter, Chris Hedges, formerly a reporter for The New York Times and now an activist at the Nation Institute, complains that Manning has been muzzled from talking about "crimes, torture and killing" committed by the United States and that the conditions under which he has been prosecuted, "familiar to many Muslim Americans tried in the so-called war on terror, presage a future of show trials and blind obedience."

Those spewing such left-wing anti-Americanism are eager to pass over the fact that many of the documents Manning passed to WikiLeaks were dropped onto the Internet by Julian Assange and contained the names of individuals around the world who had met with American diplomats or cooperated with American forces. Some of these individuals were simply innocent civilians in places like Iraq and Afghanistan who tried to help our soldiers. Others were dissidents and underground writers in repressive countries. Through Manning's actions, the lives of every one of these individuals was placed at risk.

Just to take one example of many, back in 2011 the Globe and Mail reported that leading Chinese academics and human rights campaigners were "attacked as 'rats' and 'spies' after their names were revealed as U.S. Embassy sources in the unredacted WikiLeaks cables that have now been posted online."

Among other things, the real names of a number of Chinese bloggers, previously only known by their screen names, were contained in some of the cables that Manning distributed. The Globe and Mail report comments: "The repercussions could indeed be dire in some circumstances, particularly for Tibetan and Uighur activists exposed as having passed information to Washington."

Is this kind of exposure the work of a legitimate whistleblower? The indiscriminate mass leaking that Manning engaged in was recklessness of a high order. However much one wants to temper justice with mercy when a young person commits a crime, it is Manning's recklessness that demands he face a harsh sentence.

By the same token, it is right that Manning was acquitted of the charge of "aiding the enemy." His crime did not aim so much at giving enemies an advantage as injuring the United States. Our government is acting fully within its rights and with justice on its side when it punishes someone who betrays his oath, abuses his position of responsibility in a way that weakens our country and imperils friends and allies around the world.

Follow @CNNOpinion on Twitter.

Join us at Facebook/CNNOpinion.

The opinions expressed in this commentary are solely those of Gabriel Schoenfeld.