Yesterday a unanimous panel of the Ninth Circuit issued an order and a brief opinion in State of Washington v. Trump, a challenge to the legality of President Trump’s executive order imposing a temporary moratorium on travel visas from seven designated countries — six of them countries racked by civil war and virtual anarchy, plus one country (Iran) from which we cannot get reliable information relevant to processing visas. Trump detractors were elated. I can scarcely remember a lower court opinion so eagerly anticipated or so enthusiastically received. (By comparison, litigation brought by 25 states over President Obama’s far more significant immigration order barely received any coverage or attention at all, when argued and decided in the lower courts.)

Much of the interest, and hysteria, was predicated on a demonstrably false characterization of the Order as a “Muslim ban.” President Trump has only himself to blame for that misunderstanding, since he called for such a ban on the campaign trail and his Administration offered almost no explanation of the narrow scope or the justification for the Order. It was almost as if the Administration hoped to set off a hysterical and uninformed debate, or to throw the immigrant and refugee community into a state of fear and uncertainty. I cannot believe that to be true, but sometimes carelessness and haste have the same effect that malice would.

This litigation has been terribly rushed. The district court issued a nationwide temporary restraining order without even providing an explanation of why the court regarded the Order as unconstitutional. The lawyering — at least the oral advocacy — has been weak and unprepared. The incompetent and overhasty implementation of the executive order, leading to chaos and distress, gave the Order an aura of illegitimacy. The President’s inappropriate personal criticism of the judges and the judicial process did not help his case.

All this makes the Ninth Circuit’s decision understandable as a human matter. As a legal matter, though, I believe it was wrong. Here are what I see as the principal logical errors:

Standing

This is the principle that only the persons legally injured by government conduct can sue to challenge its legality. The Ninth Circuit ruling effectively holds that states can challenge federal immigration policies on the ground that key state institutions are affected by the presence or absence of non-citizen students or faculty. That is unprecedented. It is like holding that a grocery store could challenge taxes imposed on its customers because they will have less money to spend at the store. The court did not seem to reflect on the broad implications of its ruling, but instead relied on technical readings of not-quite-analogous cases in different contexts.

The cases cited by the Ninth Circuit fall into two categories. One consists of cases in which the parties directly regulated by the law sue to block enforcement of the law against themselves on the ground that it violates the constitutional rights of others. Examples are the doctors in Roe, who would face criminal penalties if they performed an abortion and invoked the privacy rights of their patients, or the religious school in Pierce v. Society of Sisters, which was losing its accreditation and invoked the free exercise of religion by its students.

But in this case the State of Washington is not a regulated party. It is suing to block enforcement of the executive order against other people. The cases do not support any right of parties not themselves subject to a law to challenge a law based on the legal rights of others, even if they do business with those other people.

The second category consists of cases where the plaintiff has a special relation with the alien (spouse, for example) such that the plaintiff’s own constitutional rights are affected by the exclusion. The State has no special relationship with the affected aliens. True, in a narrow class of cases, states may sue parens patriae on behalf of their citizens, but aliens are not citizens of Washington.

Due Process, Problem One

Turning to the merits, the State of Washington claims first that the executive order violates the due process rights of the affected aliens. That is an uphill battle. The President has statutory authority to suspend the entry of “any class of aliens” into the United States. 8 U.S.C. § 1182(f).

In Kleindienst v. Mandel, 408 U.S. 753, 762 (1972), the Supreme Court rejected a similar claim brought by an alien refused entrance to the United States, stating “It is clear that [the alien] personally, as an unadmitted and nonresident alien, had no constitutional right of entry to this country as a nonimmigrant or otherwise.”

The Ninth Circuit sidestepped the clear holding that unadmitted and nonresident aliens have no constitutional right to entry by reference to procedural due process, meaning “notice and a hearing.” But that is not the issue.

Aliens have no fewer procedural rights than they had under the prior law. They can apply for visas and protest the cancellation of visas, exactly as before. The executive order relates to substance: residents of seven specific countries will not be permitted to travel to the United States for a temporary time while security procedures are heightened.

The State’s theory had nothing to do with hearings or notice. Its claim was that exclusion of aliens from the seven designated countries was irrational and likely motivated by anti-Muslim bias.

The Ninth Circuit did not base its decision on those theories, and rightly so. The President has plenary authority to decide that aliens from particular nations present security risks. That decision is not reviewable. The President is not like an administrative agency, whose decisions can be challenged in court for want of substantial evidence. (The court did second-guess the President’s security determination for purposes of assessing the need for a stay, where the government, as movant, had the burden of proof, but not for the merits, where the plaintiff had the burden.)

Due Process, Problem Two

The Ninth Circuit did not hold that aliens abroad who do not presently hold visas or green cards have any constitutional right to travel to the United States. That is the vast majority of applications of the executive order. The court spent several paragraphs explaining why the Order cannot constitutionally be applied to green card holders.

But the Administration says the executive order never properly applied to green card holders, and after initial confusion about that question, has not applied it to them. In court, the government also conceded the Order could not apply to previously admitted aliens temporarily abroad. The Ninth Circuit panel stated that in addition to these two classes, the Order might also be unconstitutional as applied to unlawful aliens now inside the country and to some other aliens with close relations to U.S. citizens.

Even assuming the court is right about all four groups (which is far from certain), the fact remains that the Order is constitutional with respect to the vast majority of its applications. Thus, the temporary restraining order (TRO) halting the Order in its entirety is improper.

The Ninth Circuit did not dispute that the TRO is overbroad. The court refused to narrow the TRO solely because the government’s concessions did not extend to two of the four classes the court thinks might be entitled to protection: “There might be persons covered by the TRO who do not have viable due process claims, but the Government’s proposed revision leaves out at least some who do.” That is no reason not to narrow the TRO with respect to all the many applications to which the Order is plainly constitutional.

The court then said: “More generally, even if the TRO might be overbroad in some respects, it is not our role to try, in effect, to rewrite the Executive Order.” That is precisely backwards.

If the State of Washington’s case is a facial challenge, the existence of a nontrivial number of constitutional applications is reason to reject the challenge. If the State of Washington’s case is an as-applied challenge, relief must be confined to those applications that are unconstitutional. The cases are not precisely parallel, but it bears mention that when the Supreme Court found the Obamacare statute unconstitutional in some but not all respects, it went out of its way to preserve the rest.

Establishment Clause

After toying with the possibility of holding that the executive order is impermissible because of the supposed subjective anti-Muslim bias of Donald Trump, the Ninth Circuit declined to decide the Establishment Clause argument, leaving the decision to rest entirely on the due process arguments already discussed. Along the way, the court in dictum opened the door to considering evidence of improper motivation on the part of the President. That will probably be the focus of the litigation going forward, at which point the court will have to confront Supreme Court precedent stating that “We hold that when the Executive exercises [the power to exclude an alien] on the basis of a facially legitimate and bona fide reason, the courts will neither look behind the exercise of that discretion, nor test it by balancing its justification against the First Amendment interests of those who seek personal communication with the applicant.” Kleindienst, 408 U.S. at 770.

Going Forward

What will happen, going forward? The smartest move by the Administration is to revise the executive order to make clear that it only applies to unadmitted and nonresident aliens, whom the Supreme Court has stated have “no constitutional right of entry to this country as a nonimmigrant or otherwise.” That would render the due process holding of the court, which was the only issue reached, moot.

I fear that slogging forward in the Court of Appeals, before the same panel, is unlikely to be successful, and that returning to the district court will lead to endless battles over executive privilege, in which the Administration will take the same position any executive would take, but which will be treated as uniquely Trumpian defiance of judicial authority. Better to correct the Order and start afresh, with organized implementation and full public explanation.