In other situations, the Supreme Court has a much lower bar for what qualifies as unconstitutional discrimination on the basis of religion. Indeed, in Masterpiece Cakeshop v. Colorado Civil Rights Commission, decided just a few weeks before the travel ban case, the Supreme Court overturned a decision from a state civil rights commission in a case regarding a baker who declined to prepare a cake for a same-sex wedding ceremony for religious reasons. Although the commission had originally concluded the baker had violated state antidiscrimination law, the Court found that two of the group’s seven members had made biased statements against the baker’s religion—meaning that his case hadn’t been afforded the neutral treatment demanded by the First Amendment’s free exercise clause—and invalidated the commission’s decision. The Court reached that decision even though the commission would quite likely have ruled against the baker regardless of the prejudices of the two members (the other five commissioners also supported the ruling). All five of the justices who voted with the majority in the travel-ban case were part of the 7–2 majority in Masterpiece Cakeshop.

Read: How the Supreme Court used ‘protecting families’ to justify the travel ban

Why the difference between the two cases? As Chief Justice John Roberts explained in his majority opinion in the travel ban ruling, the answer is that courts defer to the government far more in immigration cases than practically any other area in which constitutional rights are at stake. As he put it, judicial “inquiry into matters of entry and national security is highly constrained.”

The travel ban is far from the only case in which immigration restrictions have been held to a lower constitutional standard compared with almost any other exercise of government power. In August, the Israeli government was rightly criticized for barring entry to two American members of Congress because of their support for the anti-Israel Boycott, Divestment, and Sanctions (BDS) movement. But few recalled that the U.S. also has a long history of banning foreigners with political views that the government disapproves of. Concerns that European immigrants had dangerous political views were a major motivation behind the highly restrictive 1924 Immigration Act, and were also used to justify barring many Jewish refugees from Nazi Germany in the 1930s. Even today, the law forbids entry to anyone who has been a “member of or affiliated with the Communist or any other totalitarian party.” Meanwhile, the government cannot discriminate against U.S. citizens who share those same views, including by denying them government services available to others.

Similar constitutional double standards pervade many other aspects of immigration policy. Courts have ruled that the due process clause of the Fifth Amendment provides for paid counsel in most cases where the state threatens indigent individuals with severe deprivations of liberty. But indigent migrants targeted for detention and deportation are not entitled to free legal representation, and often have to navigate a complex legal system without assistance. This leads to such horrific absurdities as toddlers “representing” themselves in deportation proceedings. You don’t have to be a lawyer to recognize that this does not comport with the due process of law required by the Fifth Amendment.