Mr. Obama’s Justice Department, however, convinced a Florida federal judge that even if Mr. Gilbert’s sentence was illegal, he had to remain in prison because prisoners should not be able to petition more than once for release. The “finality” of criminal cases was too important, the department argued, to allow prisoners more than one petition, even if a previous one was wrongly denied.

A federal appellate court disagreed, and in June 2010, three judges set Mr. Gilbert free. The judges rejected the administration’s argument as a departure from basic fairness and explained that it simply could not be the law in America that a person had to serve a prison sentence that everyone admitted was illegal. Mr. Gilbert returned home and stayed out of trouble.

Here’s where it gets interesting. There are many people like Mr. Gilbert in America’s federal prisons — people whose sentences are now obviously illegal. Instead of rushing to ensure that all those thousands of men and women illegally imprisoned at taxpayer expense were set free, the Justice Department said that it did not want a rule that allowed other prisoners like Mr. Gilbert to retroactively challenge their now illegal sentences. If the “floodgates” were opened, too many others — mostly poor, mostly black — would have to be released. The Obama administration’s fear of the political ramifications of thousands of poor minority prisoners being released at once around the country, what Justice William J. Brennan Jr. once called “a fear of too much justice,” is the real justification.

In May 2011, the same court, led by a different group of judges, sided with the original judge, saying that the “finality” of sentences was too important a principle to allow prisoners to be released on a second rather than first petition, even if the prison sentence was illegal. A contrary rule would force the courts to hear the complaints of too many other prisoners. Mr. Gilbert was rearrested and sent back to prison to serve out his illegal sentence.

Judge James Hill, then an 87-year-old senior judge on the appellate court in Atlanta, wrote a passionate dissent. Judge Hill, a conservative who served in World War II and was appointed by Richard M. Nixon, called the decision “shocking” and declared that a “judicial system that values finality over justice is morally bankrupt.” Judge Hill wrote that the result was “urged by a department of the United States that calls itself, without a trace of irony, the Department of Justice.”