WASHINGTON — In a setback for the Trump administration, the Supreme Court on Thursday rejected its stated reason for adding a question on citizenship to the census, leaving in doubt whether the question would appear on the census forms sent to every household in the nation next year.

Chief Justice John G. Roberts Jr., writing for the majority, said the explanation offered by the Trump administration for adding the question “appears to have been contrived.” But he left open the possibility that it could provide an adequate answer.

Executive branch officials must “offer genuine justifications for important decisions, reasons that can be scrutinized by courts and the interested public,” the chief justice wrote. “Accepting contrived reasons would defeat the purpose of the enterprise. If judicial review is to be more than an empty ritual, it must demand something better than the explanation offered for the action taken in this case.”

The practical impact of the decision was not immediately clear. While the question is barred for now, it is at least possible that the administration will be able to offer adequate justifications for it. But time is short, as the census forms must be printed soon.