The issue involves what is known as the Administrative Procedure Act, which does not allow actions by federal agencies considered to be "arbitrary, capricious, an abuse of discretion, or otherwise not in accordance with law."
In his majority ruling, Chief Justice John Roberts all but accused Secretary of Commerce Wilbur Ross of lying to the courts and Congress about the process involved in trying to add the citizenship question, and why it was being done, as the Court rejected the assertion that it involved the Voting Rights Act.
"Altogether, the evidence tells a story that does not match the Secretary’s explanation for his decision," Roberts wrote in the 5-4 decision, describing the main argument from the Trump Administration as 'contrived.'
"If judicial review is to be more than an empty ritual," the Chief Justice wrote, "it must demand something better than the explanation offered for the action taken in this case."
"In a nutshell, the Court did not decisively reject the inclusion of a citizenship question, but today's decision is going to make it _very_ difficult, both legally and logistically, for the government to ultimately ask the question," said Steve Vladeck, a law professor at the University of Texas.
In Congress, Democrats vowed to keep pushing for answers from the Commerce Department on the machinations behind the citizenship question, with lawmakers convinced that Ross and other officials have not told the truth about their efforts.
"Commerce Secretary Wilbur Ross testified before Congress that the Trump Administration was adding the citizenship question to the census ‘solely’ at the request of the Justice Department to help enforce the Voting Rights Act," said Rep. Elijah Cummings (D-MD).
"The Supreme Court has now eviscerated this claim, calling it a ‘pretext,’ ‘contrived,’ and ‘incongruent with what the record reveals,'" said Cummings, who has fought with GOP lawmakers to enforce subpoenas for more testimony about the Census decision-making by the Trump Administration.