It was an act of simple decency. On Tuesday, President Barack Obama commuted the sentence of Chelsea Manning, who was serving a 35-year sentence for leaking a large trove of classified information. This was unquestionably the right thing to do, and helps redress a civil liberties record that is a relative weak spot in Obama's legacy.

This is not to say that the decision to charge Manning was, in itself, indefensible. There is no question that Manning giving classified materials to WikiLeaks was illegal. Should she have been exempted from prosecution as a whistleblower? It's not an absurd argument. Certainly, much of the information she released — such as video of an appalling helicopter attack on a crowd in Baghdad that killed two Reuters reporters whose cameras were misidentified as guns — was unquestionably in the public interest.

But one problem with that argument is how indiscriminate Manning was about the information she chose to release. As the political scientist Robert Farley of the University of Kentucky observes, it would be impossible for her to make crucial distinctions about what materials should be leaked because "she lacked sufficient expertise in the subject matter to tell the difference between material that was properly and improperly classified." Information the state had a legitimate interest in keeping confidential was leaked alongside information that should have been made public.

Given these factors, it was unrealistic to expect Obama to pardon Manning, which would have absolved her of guilt. But there are two reasons — each of which would be sufficient in itself — why the case for commuting Manning's sentence was not merely plausible, but compelling.

First, Manning's sentence was grossly disproportionate. Prosecuting leakers is very rare, although Obama went after whistleblowers to an unprecedented extent. The seven people prosecuted for leaking information to the media by Obama constitute 70 percent of the people prosecuted for this crime in the history of the United States. And there is certainly no precedent for anything remotely resembling a 35-year sentence for leaking information to the media. Sentencing Manning to time served would have been towards the harsh end of what was potentially justified. Arbitrarily singling out Manning for an extraordinarily harsh punishment is exactly the kind of injustice the commutation power should be used to redress.

And, second, not only has Manning been in prison much longer than her offense merited, the conditions she was subjected to in prison were a vile abuse of human rights. She was held in solitary confinement for extended periods, treatment that amounts to torture in practice, even if it's not defined as such in law. She remained in a man's prison despite announcing her gender identity as a woman in 2013. She detailed the effects of this treatment in her letter to Obama: "I am living through a cycle of anxiety, anger, hopelessness, loss, and depression. I cannot focus. I cannot sleep. I attempted to take my own life." She was actually punished for her suicide attempt with more time in solitary confinement, an act of astonishing cruelty.

The disproportionate length of the sentence given to Manning and the cruelty she was subjected to in prison make commuting her sentence a no-brainer.

This doesn't mean that Obama's opponents didn't attack it. Republican Speaker of the House Paul Ryan called Obama's commutation "outrageous," asserting that "President Obama now leaves in place a dangerous precedent that those who compromise our national security won't be held accountable for their crimes." The idea that seven years of hard prison time in often deplorable conditions doesn't constitute "accountability" reflects an appalling lack of human decency.

The harsh treatment given to Manning is particularly hard to justify given that most of the people responsible for the financial collapse of 2008 and all of the people responsible for the torture of prisoners under the Bush administration got away scot-free. While it's too late for many of the worst villains of the first decade of the millennium to be held accountable, it's important that other injustices be addressed.

Obama made the right call in commuting Manning's sentence, and it's a sobering reminder of a general commitment to decent values that Obama's successor utterly rejects. Obama didn't always do what the liberal wing of the Democratic Party would have liked, but he often still did what was right.