Partisanship cannot be completely excluded from Supreme Court decisions, but seldom has it been on as clear display as in the recent opinion in Hawaii’s lawsuit against the travel ban instituted by the Trump administration. That ban affected visitors coming from Chad, Iran, Iraq, Libya, North Korea, Syria, Venezuela and Yemen. A straightforward decision on principles of separation of powers became instead a judicial referendum on President Trump.

President Trump started out ill-advisedly on this course of action. His first travel ban affected many travelers already in the air flying to the United States, causing turmoil at international airports around the country. Some were sent back. Some were held at airports. Legions of attorneys descended on courts seeking injunctions. A federal district judge in Hawaii granted an injunction applying not just to Hawaii, but to the entire United States. While court challenges were pending, the travel ban was withdrawn and replaced twice. The third iteration was based on research done by the Department of Homeland Security and the U.S. State Department that had not been done at the time of the original ban. President Trump showed himself ill-prepared, unaware of relevant laws, and disrespectful of the methods of law with which our country’s Executive Branch operates in more normal times.

At bottom, however, it wasn’t any procedural error that led to the Hawaii federal judge’s opinion. It was an abundance of ill-chosen words from President Trump’s campaign, promising to keep Muslims from immigrating to the United States, which formed the basis of the opinion. Those statements were repeated in the principal dissenting opinion of Supreme Court Justice Sotomayor. Her conclusion was that the travel ban was created and enforced out of President Trump’s prejudice against Islam, which the First Amendment prohibits. A particularly sharp jab was hurled by Justice Sotomayor, likening Chief Justice Roberts’ majority opinion to the infamous 1944 Supreme Court opinion permitting Japanese-Americans’ internment.

The court’s majority opinion methodically analyzed the separation of powers fundamental to our nation. The immigration laws created by Congress gave no right for anyone to visit the United States. Those laws did give the president the authority to decide who should receive travel visas, taking into account the best interests of our country. The president is uniquely positioned in our government to know facts affecting national security that often cannot be shared publicly. As well, he alone conducts foreign diplomacy, and if we need to get tough with one country or another by restricting their citizens from entering ours, that’s a bargaining chip the president is allowed to use.

Since the travel ban was so clearly within the president’s authority on its face, the majority did not reach the questions that would have had to be answered if the dissenting justices had had their way. What amount of campaign rhetoric qualifies as a finding of bias? How much bias is enough to overcome a bona fide concern for national security? How would a court decide the case of a biased president who nonetheless had a solid basis for banning visitors from a particularly unreliable country? How long should a president’s campaign statements taint his actions as president — a year, a presidential term, eight years? Just asking these questions all point to one answer: these issues are not for a court to decide. Whatever the number of false starts and offensive rhetoric of the Trump administration, a judge should not be able to override a presidential decision on how best to protect our country. Nor should a single judge in Hawaii be able to issue a decree for the entire nation.

Finally, justices are human. Accusing a fellow justice of supporting the logic that permitted Japanese-American internment creates an obstacle to achieving a reasoned compromise with that justice in the future. We’ve already seen how insults have poisoned the other two branches; it’s distressing to see that seep into the judicial branch as well.

Tom Campbell is a professor of law and a professor of economics at Chapman University, teaching separation of powers among other subjects. He was a law clerk to U.S. Supreme Court Justice Byron White, and a professor of law at Stanford for nineteen years.