In a sad but unsurprising denouement this week, the Supreme Court tossed out a federal appellate court ruling that would have required the government to release photographs of soldiers abusing prisoners in Iraq and Afghanistan during the Bush administration.

The vacated ruling by the United States Court of Appeals for the Second Circuit, in New York, was based on sound precedent and principles of government openness and accountability. With help from Congress, President Obama managed to void those principles and poke a large retroactive hole in the Freedom of Information Act.

Mr. Obama had originally supported the release of the photographs. Then, in May, he flip-flopped and decided to resist court orders to make them public. He then threw his weight behind a bill giving Defense Secretary Robert Gates the authority to withhold pictures relating to “the treatment of individuals engaged, captured, or detained after Sept. 11, 2001,” by American troops.

The law was passed in October. Mr. Gates exercised the power in November. And the justices cited the law in sending the case back to the appellate court, which must now rethink its ruling.