THERE IS a familiar, and crude, retort people sometimes make to attempted lies, which we will paraphrase as follows: “Don’t pour water on my leg and tell me it’s raining.” That old saw also summarizes the Supreme Court’s wise controlling opinion that blocked, at least temporarily, the Trump administration’s attempted inclusion of a question about citizenship in the 2020 Census.

Spearheaded by Commerce Secretary Wilbur Ross, the administration offered various supposed rationales for its insistence on changing the recent practice of the Census Bureau in this respect, despite expert warnings it would disproportionately depress the response rate among Latinos. The most prominent of the administration’s claims was that the information would help enforce the Voting Rights Act. Yet internal records produced in a New York federal court make clear that this was concocted, apparently to obscure the administration’s actual motive: political advantage for Republicans in redistricting.

Although the Supreme Court’s usual rule is to defer to congressionally authorized policymaking by an administrative agency, Chief Justice John G. Roberts Jr. wrote, pointedly, the justices “are ‘not required to exhibit a naiveté from which ordinary citizens are free.’ ”

The chief justice’s narrow ruling, opposed by the court’s four other Republican appointees and joined by the four Democratic appointees, rescues two institutions from legitimacy crises — at least temporarily. The first institution is the court itself, which has avoided looking like a rubber stamp for the party that propelled a majority of its members to the bench. The second is the census, which depends on impartiality, real and perceived, for its effectiveness.

What happens next is far from clear. The Supreme Court’s ruling could return the case to the New York federal district judge, Jesse Furman, whose previous convincing ruling against inclusion of the citizenship question rested on his well-founded and well-reasoned view that it violated federal law. Meanwhile, another challenge based on a claim of racial discrimination is percolating in Maryland, where a different federal judge is about to consider the issue in light of new evidence that the entire citizenship question enterprise got started not with an impartial agency process but at the suggestion of Thomas Hofeller, a recently deceased Republican gerrymandering expert.

Mr. Roberts correctly opined that there is nothing intrinsically unconstitutional or unlawful about including a citizenship question in the census; it has been done many times before in U.S. history. What he and the other members of the majority recognized, though, is that how government goes about including such a question makes all the difference.

President Trump said in a tweet that he intends to fight the ruling. There is nothing the Trump administration can do at this late date — previously, its lawyers had said the census form had to be prepared in final form no later than July — to cure its bad faith. If the real objective is to have a more accurate census, produced with due deliberation and full public confidence, the administration should be content to plan for a citizenship question in 2030, well beyond the partisan time horizons of most current elected officials. That would be fair and intellectually respectable; continuing the court battle for its discredited position would not.

Read more: