I'm not a lawyer and can't comment on the legality of the president restricting entry to the US, but as a general principle I think it's sensible to restrict Muslims from entering the US.  Islam is inherently a violent religion (read the Quran, please).  For years we excluded Communists for similar reasons.  

The fact that most of these Muslims aren’t ‘white’ is neither here nor there.  For many decades the US excluded Chinese immigrants—not because of violence but because they had demonstrated thatthey tended not to assimilate—and,though I can’t speak to statutes, the Constitution has never been amended since that time in any way that would invalidate a simila national or ethnic-based restriction.

The protections citizens have against discrimination (some of which were ‘read into’ the Constitution by activist courts, and certainly aren’t in the plain meaning of the text) simply do not apply to foreigners outside the country who desire entry.