Obviously, some orders a president gives AREN'T subject to judicial review: orders that take effect outside the USA, for example. Orders which affect what happens in the USA are, of course, subject to judicial review, just as we've seen in this case and in the loss Obama suffered on immigration.

Obama's immigration order was shot down for the same reason Trump's was: it was going to cost state legislatures money. However Obama couldn't justify his immigration order on the basis of national security. Trump can at least offer it as a reason. Moreover, Trump's order was just temporary, lasting only 90 days. Obama's order would have entrenched an immigration status that would continue to cost states until a new law was made. The balance the judges will have to strike, in my opinion, is between the valid authority the president has over national security, versus a temporary cost the states will face. 

Again, I can see sound reasons why Trump might prevail on this one.