There is no constitutional right to have open borders. If there were, such as if the bill of rights said the government shall not infringe on the right of the people to have open borders, this might be analgous to banning guns using President's power to declare a national emergency.
The reality is President Trump or any president, is going to have wide latitude to declare a national emergency, use the powers granted to him under that national emergency, and withstand scrutiny.
The only issue on appeal is going to be whether or not it encroaches on the power of the purse. Since funds are being moved. But it will hinge on the definition of "appropriation." Money was already appropriated by Congress to the Military. Then within the Military law or regulation it is being re-allocated under the Construction Budget. That's why it is probably likely to prevail in the Supreme Court.