1. Professor Eric Posner points out:
The Supreme Court has held consistently, for more than a century, that constitutional protections that normally benefit Americans and people on American territory do not apply when Congress decides who to admit and who to exclude as immigrants or other entrants. This is called the plenary power doctrine. The Court has repeatedly turned away challenges to immigration statutes and executive actions on grounds that they discriminate on the basis of race, national origin, and political belief, and that they deprive foreign nationals of due process protections. While the Court has not ruled on religious discrimination, it has also never given the slightest indication that religion would be exempt from the general rule.
There is even precedent for Trump’s plan. In 1891, Congress passed a statute that made inadmissable people who practice polygamy (directed, at the time, at Mormons), and in 1907 extended this ban to people who “who admit their belief in the practice of polygamy.” While Congress later repealed the latter provision (the former seems to be still on the books), no court–as far I know–ruled it unconstitutional.
I would add that, in Kleindienst v. Mandel (1972), the Supreme Court applied the “plenary power doctrine” to the exclusion of people based on their political beliefs, despite the Free Speech Clause. The cases that Posner is referring to, together with Kleindienst, suggest that the exclusion of people based on their religious beliefs is likewise constitutional.
Posner notes that “The plenary power doctrine is universally loathed by scholars and some have argued that it is effectively a dead letter.” It may well be that, if faced with the issue, the Supreme Court would change the case law on this. But at this point, the precedents counsel in favor of the constitutionality of such a rule.
2. Posner points out that “blocking American Muslims overseas from entering the country would certainly be unconstitutional.” That is absolutely right: U.S. citizens have a constitutional right to come back to the United States — the government can’t exile citizens even for crimes, much less for having the wrong religion.
3. Posner also notes that “blocking immigration by Muslims would raise complicated international-law questions.” I don’t know enough about the subject to opine on that, but this is also something to keep in mind.
4. As a policy matter, I think that banning entry by Muslims would be a very bad idea, for many reasons. But, like many very bad ideas, it might not be unconstitutional.
UPDATE: See also the post on the subject by Jacob Gershman (Wall Street Journal Law Blog), Steven Nelson (U.S. News), and Eyder Peralta (NPR). Akhil Amar and Stephen Legomsky agree with Eric Posner and me; Laurence Tribe and Daniel Halberstam think the proposal would be clearly unconstitutional (even as to aliens); Michael Dorf, Gerald Neuman, and Stephen Yale-Loehr think it’s a close case (which is consistent with Eric Posner’s and my view, given the possibility that today’s Court would indeed overrule or limit the plenary power doctrine precedents).