Bradley Manning has been sentenced to thirty-five years in prison. Military prosecutors had asked for sixty years, out of a possible ninety; his lawyer, David Coombs, had asked for “a sentence that allows him to have a life.” Manning is twenty-five years old now. A thousand two hundred and ninety-four days, about three and a half years, will be subtracted from his sentence—time served plus a hundred and twelve days to penalize the government for treating him in an illegally abusive way while he was in detention. These numbers are out of proportion; this sentence, given all we know about Manning and what he did (and what was done to him), is a strikingly harsh one.

Manning gave hundreds of thousands of classified war logs and diplomatic cables to WikiLeaks. He also gave them a video, filmed from an Apache helicopter, of American forces firing on people in the streets of Baghdad with what Manning, according to his testimony, took to be heartbreaking blitheness. He was already pretty torn up, hardly more than twenty years old, realizing he was gay, wondering if he should have been born a woman, in the middle of a war zone. He thought, his lawyer argued in the trial, that he might save someone, or everyone. However one measures that choice, one of the scandals of this court martial was how the government cast aside Manning’s own gestures of contrition. He offered to plead guilty to enough counts to put him in prison for twenty years. The prosecutors pressed on, insisting on trying him under the Espionage Act and for “aiding the enemy.” (I’ve written about that decision before.) On that last count, which was novel in this sort of case and would have set a disastrous precedent for press freedom, Manning was acquitted. But the Espionage Act charges are broadly damaging, too.

The sentence will be appealed, and Manning will be eligible for parole in about eight years. Whether he gets it then is likely to be as politicized a matter as this court martial was from the beginning. He was also dishonorably discharged.

What is the point of this sentence? The prosecutors had a simple answer: there had to be a deterrent. (“This court must send a message to any soldier contemplating stealing classified information,” a prosecutor said in the sentencing hearing.) A frightening, crippling sentence was the only way to make sure that no one leaked again, ever. What it seems likely to do is chill necessary whistle-blowing and push leakers to extremes. The lesson that Edward Snowden, the N.S.A. leaker, seems to have drawn from the prosecutions of Manning and others is that, if you have something you think people should know, take as many files as you can and leave the country. It also places the deterrent in the wrong place. What combination of over-classification and security bureaucracy requires almost five million people in this country to have security clearances—almost a million and a half with top-secret clearance, which is what Manning had, or higher? That’s also why Snowden, a private contractor, saw what he did.

Manning’s officers kept him on a job involving intelligence reports even though he’d sent one of them a picture of himself dressed as a woman and had been found on the floor of his office with a knife. One of them testified that he was just really short-staffed. Manning, at his sentencing hearing, apologized for any harm he had done, and said that he was ready to pay a price: “I did not fully appreciate the broader effects of my actions. Those factors are clear to me now,” he said. He also added, “I know I can and will be a better person.”

His sentence could and should have reflected the way the military had also let him down, badly. “This is a young man who is capable of being redeemed,” Coombs said at the sentencing hearing. “We should not rob him of his youth.” Some of that had already been stolen. He joined the Army after having not much more of a home than the couch in his married older sister’s one-bedroom apartment. That sister, Casey Major, testified at his sentencing hearing that, when she was eleven and he was a newborn, she would get up at night to care for him when he woke up, because both of their parents would be passed out drunk. When he was twelve and she had to drive their mother, who had tried to kill herself with an overdose of valium and alcohol, to the hospital, he was the one who had to sit in the backseat with her, to make sure she was still breathing.

That is the human part of the equation. There’s more, and all in directions that ought to have tended toward a little mercy for Manning. The WikiLeaks files have been a useful and important part of what had been about a dozen underdeveloped debates about our wars and foreign policy. The prosecutors, despite using words like betrayal frequently, had trouble, at the sentencing, showing specific harm, as opposed to diffuse embarrassment. And against thirty-five years, a hundred and twelve days seems like a paltry penalty for Manning’s extreme solitary confinement and his abuse. Where is the deterrent for that?

Was the deterrent meant to be the number of years—because twenty is already a lot—or the threat of the Espionage Act itself? There are laws against giving away classified files, including those Manning offered to plead guilty to. Why was it so important to call him a spy? An answer is that we have reached a point where our government, and allies like Britain, can’t tell the difference between leak investigations and espionage and terrorism.

It is also on that score that the detention of David Miranda, the partner of Glenn Greenwald, the Guardian journalist who received files from Snowden, is so dangerous. Miranda, a Brazilian citizen, was held for nine hours while in transit at Heathrow Airport under a section of Britain’s Terrorism Act. He was on his way from Berlin, where he had stayed with Laura Poitras, the documentary filmmaker who is also on the Snowden story; he was carrying some files from her for Greenwald. His computer, memory cards, and a video game he was carrying were all seized by British officials. Some observers have argued that the British were within their rights, since Miranda may have had secrets with him. Shouldn’t it be clear that this would have been a gross overreach even if Greenwald had been the one detained? The Terrorism Act is bad and broad—but it’s not that broad. It does say that these detentions are supposed to be about terrorism. Either the law was abused, as even many British politicians seem to believe, or the definitions of investigative journalism and being involved with terrorism have been horrendously conflated, which amounts to the same thing.

How was Miranda involved in terrorism, even putatively? Saying that the public revelations about surveillance made it harder for the N.S.A. to continue on as before is not an adequate answer. For one thing, it could apply to almost any act of journalism that brings about change. The role of the press is to challenge the government’s practices. Couldn’t one just as easily say that, by imposing more of a cost on, for example, work habits that include almost three thousand rule-breaking incidents a year, investigative journalism might make the agency operate better? There are other laws that might have been used, and the British don’t get a pass for this being the most convenient one for them. (Or for us: the Obama Administration was informed about Miranda’s detention beforehand.) If Miranda could be pulled off with the word “terrorist,” what journalist who has written about classified information—or their colleagues or relatives—couldn’t be? Some will be more or less isolated, politically or emotionally. (“I knew my country would protect me, and I believe in my husband and knew that he would do anything to help me,” Miranda told the Guardian.) But the turning point, both for freedom of the press and for privacy and unlawful search and seizure, is one we’re all at.

Miranda’s detention was joined with an extraordinary incident (which my colleague John Cassidy has written about) that ended with British intelligence officers standing in the Guardian offices while computer equipment holding files from Snowden were smashed into small pieces. There are other copies, including, perhaps, at the paper’s offices in New York. We are, as Alan Rusbridger, editor of the Guardian, has written, lucky in this country to have a press with a better shot at avoiding prior restraint. But both the Manning and Snowden cases show why that is at risk. They also show why it’s worth pushing back, and fighting.

Photograph by Mark Wilson/Getty