Your points may be valid, but the law(s) as written mean nothing when a judge say they mean something else. That’s what happened here with the 9th circuit. Liberal judges see the law as a topical heading under which they can exert their partisan ideas and agenda. The letter of the law isn’t even secondary with them.
Don't forget: Trump likes to WIN. He's been dealing with hacks like this for 40 years. Immigration was his SIGNATURE issue. He will win this.