You're certainly working overtime to avoid a simple and obvious point: judges take intent into decisions all the time, both both from public statements and even the end results of an order or bill. It's not the judge's fault Trump didn't know that.
Your ignorance is nobody's fault but your own.
You are ignoring the fact the Supreme Court has made very clear that courts are not to do the very thing the Fourth Circuit just did. It said this in a 1972 decision, Kleindienst v. Mandel:
"[W]hen the Executive exercises [its] power negatively on the basis of a facially legitimate and bona fide reason, the courts will [not] look behind the exercise of that discretion . . . ."
Five years later, in Fiallo v. Bell, the Court said this:
"Our cases have long recognized the power to expel or exclude aliens as a fundamental sovereign attribute exercised by the Government's political departments largely immune from judicial control."
In Fiallo, the Court recalled that in Matthews v. Diaz, it had said this:
"[T]he reasons that preclude judicial review of political questions also dictate a narrow standard of review of decisions made by the Congress or the President in the area of immigration and naturalization."
In a 1952 case, Harisiades v. Shaughnessy, Justice Frankfurter wrote a concurring opinion in which he stated the Court's position on this issue, which even then was already well established. The Fiallo Court quoted Frankfurter with approval:
"The conditions of entry for every alien,
the particular classes of aliens that shall be denied entry altogether, the basis for determining such classification, the right to terminate hospitality to aliens, the grounds, on which such determination shall be based, have been recognized as matters solely for the responsibility of the Congress and wholly outside the power of this Court to control . . . ." (emphasis added).
Someone might carp that Frankfurter was affirming Congress's power to exclude aliens without second-guessing by the courts, and not the President's, although Fiallo, Matthews, and Mandel make clear that courts are to defer to both the Legislative and Executive Branches in these matters. I doubt it would have made any difference to the lawless judges in the lower federal courts if a federal law had been involved, rather than an executive order. The goal of these judges is to concoct rights for Muslim aliens out of thin air and elevate them over President Trump's authority to protect the nation from foreign threats. They are not about to let the Constitution or the law get in their way.
One solution to this lawlessness would be for Congress to make a law removing the jurisdiction of lower federal courts to hear any case involving this issue. These courts only exist at all because Congress, exercising its constitutional authority, chose to create them by law. And what Congress has power to create or dissolve, it has power to restrict.