Protesters outside of the U.S. Court of Appeals for the 9th Circuit in San Francisco on Tuesday. (Jeff Chiu/Associated Press)

IT IS possible to debate whether President Trump’s immigration executive order was callous and counterproductive, as we believe it was. But there is no question that its rollout was sloppy and arrogant — and that includes the legal defense the government mounted when inevitably challenged in court. Four federal judges have now rejected several untenable claims the Trump administration made, and rightfully so.

A three-judge panel on the U.S. Court of Appeals for the 9th Circuit ruled Thursday that the Trump administration’s restrictions on travel from seven majority-Muslim countries will remain on ice while the courts work through whether the restrictions are legal. This is only the beginning of a long battle, but there are a few arguments the judges dispensed with upfront.

For example, the government argued that the president has “unreviewable authority to suspend the admission of any class of aliens.” The court easily batted down this dangerous contention: “There is no precedent to support this claimed unreviewability, which runs contrary to the fundamental structure of our constitutional democracy,” the panel wrote. “Although courts owe considerable deference to the President’s policy determinations with respect to immigration and national security, it is beyond question that the federal judiciary retains the authority to adjudicate constitutional challenges to executive action.”

In short: Mr. Trump needs to accept that he cannot rule by decree, without regard for judicial checks. The courts can and must block him when he overreaches, especially on matters of civil liberty and national security.

The government also argued that the court should ignore a glaring problem with the president’s executive order — that it appeared to apply to green-card holders and others with legal status that rightly led them to expect that they would be able to travel into and out of the United States — because the White House counsel’s office later issued an “authoritative guidance” lifting restrictions from lawful permanent residents.

The court fired back: “At this point, however, we cannot rely upon the Government’s contention that the Executive Order no longer applies to lawful permanent residents,” the judges wrote. “The White House counsel is not the President, and he is not known to be in the chain of command for any of the Executive Departments. Moreover, in light of the Government’s shifting interpretations of the Executive Order, we cannot say that the current interpretation by White House counsel, even if authoritative and binding, will persist past the immediate stage of these proceedings.”

In other words, the Trump administration’s erratic behavior has earned it no credibility with the judiciary, and it deserves no trust that any lawful elements of the order will be executed properly without supervision.

As if to illustrate that very point, Mr. Trump responded to the court ruling in his unsettlingly juvenile fashion, condemning the decision as “political” and “disgraceful.” GOP critics pilloried President Barack Obama for issuing a relatively mild criticism of the Supreme Court’s Citizens United decision. Mr. Trump, by contrast, continues to treat the judicial branch as yet another political enemy to bully into submission — behavior that reportedly led his own Supreme Court nominee to comment that attacks on judges are “demoralizing” and “disheartening.”

The independence of and trust in the judiciary are prerequisites for a free society. What sort of society does Mr. Trump want?