See Peter Spiro, at the New York Times, "Trump’s Anti-Muslim Plan Is Awful. And Constitutional":
In the ordinary, non-immigration world of constitutional law, the Trump scheme would be blatantly unconstitutional, a clear violation of both equal protection and religious freedom (he had originally called for barring American Muslims living abroad from re-entering the country as well; he has since dropped that clearly unconstitutional notion). But under a line of rulings from the Supreme Court dating back more than a century, that’s irrelevant. As the court observed in its 1977 decision in Fiallo v. Bell, “In the exercise of its broad power over immigration and naturalization, Congress regularly makes rules that would be unacceptable if applied to citizens.”Spiro hates that Trump's plan is fully legal under current U.S. constitutional interpretation, so he blathers on with a bunch of namby-pampy objections about changing "popular consensus" and "constitutional norms," blah blah.
The court has given the political branches the judicial equivalent of a blank check to regulate immigration as they see fit. This posture of extreme deference is known as the “plenary power” doctrine. It dates back to the 1889 decision in the Chinese Exclusion case, in which the court upheld the exclusion of Chinese laborers based on their nationality.
Unlike other bygone constitutional curiosities that offend our contemporary sensibilities, the Chinese Exclusion case has never been overturned. More recent decisions have upheld discrimination against immigrants based on gender and illegitimacy that would never have survived equal protection scrutiny in the domestic context. Likewise, courts have rejected the assertion of First Amendment free speech protections by noncitizens.
Nor has the Supreme Court ever struck down an immigration classification, even ones based on race. As late as 1965, a federal appeals court upheld a measure that counted a Brazilian citizen of Japanese descent as Asian for the purposes of immigration quotas.
In the context of noncitizens seeking initial entry into the United States, due process protections don’t apply, either. This past June, the court upheld the denial of a visa for the spouse of an American citizen based on the government’s say-so, with no supporting evidence.
The courts have justified this constitutional exceptionalism on the grounds that immigration law implicates foreign relations and national security — even in the absence of a specific, plausible foreign policy rationale. The 1977 Fiallo case, for instance, involved a father seeking the admission of his out-of-wedlock son from the French West Indies — hardly the stuff of national interest.
Indeed, contrary to the conventional understanding, President Trump could implement the scheme on his own, without Congress’s approval. The Immigration and Nationality Act gives the president the authority to suspend the entry of “any class of aliens” on his finding that their entry would be “detrimental to the interests of the United States.” President Obama has used this to the better end of excluding serious human rights violators...
Let the voters figure out. The Constitution's not a suicide pact. A few more attacks like this and Hillary Clinton will be embracing a bar on Muslim migrants.
More, "Plan to Bar Foreign Muslims by Donald Trump Might Survive a Lawsuit."