The Constitution does not give the President the ability to discriminate against a religion, which is exactly what a Muslim ban does.
Ric Olie picture inserted here.
The part that is the problem is the VISA’s. There is a clause to the constitutional ammendment which gives the President this ability with regards to protection of people with VISA’s so they are not declined renewal due to Religious affiliation. If they already do not have VISA’s the President can legally keep them from entering, legally.
Sally Yates was fired because she used this clause to say no to the EO without letting it go through the courts first like she was supposed to.