Lets hear what tripleA has to say.
Any reasonable reading of law and precedent will support Trump's order. There is a long history of presidential orders limiting immigration.
Congressional Research Service: "Executive Authority to Exclude Aliens: In Brief" by Conservative Review on Scribd.
According to the report, here are the number of times each president, since Reagan, has limited immigration to specific groups of people:
Ronald Reagan - Five times
George H. W Bush - One time
Bill Clinton - 12 times
George W. Bush - Six times
Barack Obama - 19 times
Not included in the CRS report is that Hillary Clinton's State Department, without a presidential action, suspended all refugee applications from Iraq for six months in 2011. ABC News reported, on the de facto ban of Iraqis in 2013: As a result of the Kentucky case, the State Department stopped processing Iraq refugees for six months in 2011, federal officials told ABC News – even for many who had heroically helped U.S. forces as interpreters and intelligence assets. One Iraqi who had aided American troops was assassinated before his refugee application could be processed, because of the immigration delays, two U.S. officials said. In 2011, fewer than 10,000 Iraqis were resettled as refugees in the U.S., half the number from the year before, State Department statistics show. - See more at:
https://www.conservativereview.com/...the-last-five-presidents#sthash.aPcbhucE.dpuf
The legal situation is somewhat muddled because what is under appeal is not the president's order but the TRO issued by the district court judge. Federal judges have pretty wide discretion in issuing such temporary relief, and the standard of review is along the lines of "abuse of discretion" or "clear error." Given the notoriety of the case, the appellate panel may try to shortcircuit matters and get to the merits however. They could do so because the likelihood of success on the merits is the first factor in the test for issuing preliminary injunctions.
Here success on the merits seems very remote for the plaintiffs. The letter of the law and historical practice both support the president. The fact that national security is involved is another important factor that should give any prudent court reason for pause. Public outrage against the judiciary would be immense if someone admitted under injunction committed a terrorist act.
Standing is an even bigger obstacle. The plaintiffs are two states. Traditionally, states have not had standing to raise such amorphous issues as stand-ins for their residents or would-be residents. The states' claims are clearly a backdoor attempt to litigate claims, ie constitutional violations, that the would-be immigrants cannot bring themselves.