"legal view".
Certainly a Muslim ban (or ban of any other religion) would be unconstitutional. IMO, this was a "targeted muslim ban" - trump trying to (wink, wink) placate his base and check the promise bucket. He'll be ok if the judge's ruling isn't overturned (he'll tweet that he tried.)
In hindsight - what domestic terrorist acts would have this type of ban (from those 7 countries) have prevented? Z E R O
https://www.theatlantic.com/international/archive/2017/01/trump-immigration-ban-terrorism/514361/
Do persons entering the US need to be properly vetted - HELL YES; Are they currently vetted adequately - IDK - the trump regime is adjusting policy, let them show this is not the case (BURDEN.)
I do know that it was **** to detain people that had arrived/were en route to the US (legally.)