[Up to now, the court's responsibility to judge whether such an order is legal and constitutional, not if it is sound policy]
Isn't that what both judges did?  They found it violates the Fifth Amendment's Equal Protection clause because the purpose of the travel ban targets Muslims regardless of the policy's soundness, ie. it doesn't matter how sound or not a policy is if it violates the Constitution.
[ court's judged orders on what was in the order- what is says- not on campaign rhetoric.]
You are asserting that judges are supposed to ignore evidence and only look at what is written in the text itself?  Please provide a source.  Even the late Antonin Scalia accepted evidence outside the specific text of the Constitution or legislative acts, such as the federalist papers and committee minutes, to determine an issue and he was a self-professed strict textualist.