While the Republican Congress has been laughably deficient in checking President Trump's corruption and power grabs, the federal courts have been doing their job. On Tuesday, a federal district court judge blocked an executive order intending to deny federal funding to sanctuary cities. The president of the United States wasted little time in reacting, tweeting "[f]irst the 9th Circuit rules against the ban and now it hits again on sanctuary cities — both ridiculous rulings. See you in the Supreme Court!" and criticizing the winners of the suit for "judge shopping." In a subsequent interview, he expressed agreement with "the many people that want to break up the 9th Circuit."
Both the order itself and Trump's reaction to the court's ruling indicated why he's had a rough ride in the courts so far: He has no idea what he's doing.
The most obvious problem is that while U.S. District Judge William Orrick lives in the geographic area covered by the 9th Circuit — he is based in San Francisco — he does not in fact serve on that court. He's a trial judge, not an appellate one. The fact that the same president issuing executive orders apparently doesn't understand basic facts about the structure of the American judicial system is rather sobering.
Trump's threat to "break up" the 9th Circuit because "everybody immediately runs" to it doesn't make much more sense. It is true that the Constitution gives Congress the power to reorganize the federal judicial system, and some conservative legislators have floated proposals to create a new court that would cover some jurisdictions currently covered by the large and rapidly growing 9th Circuit. (Since this would mean a lot of new Republican judges — which is the real point — this would have no chance of passing the Senate as long as the filibuster remains in place.) But needless to say, even if the 9th Circuit was broken up this wouldn't stop forum (or what Trump calls "judge") shopping because suits could still be filed in the jurisdictions the 9th Circuit does cover.
It's not exactly news that Trump's tweets and interviews tend not to withstand rigorous, or even cursory, scrutiny. The bigger problem for Trump is that you can say the same thing about his sanctuary city order.
In a 1987 case which upheld the use of federal highway funds to establish a de facto national drinking age, the Supreme Court gave Congress a broad (although not unlimited) ability to use its spending power to persuade states to advance federal objectives. One of the limits that the Court placed, however, was that if Congress wants to put conditions on federal funding it "must do so unambiguously" so that states "exercise their choice knowingly, cognizant of the consequences of their participation." In addition, any conditions placed on spending must be "relevant to federal interest in the project and to the over-all objectives thereof." Congress could withhold highway spending to compel states to raise their drinking ages because it was related to the federal interest in highway safety, but it could not accomplish the same goal by threatening to withhold Social Security spending.
These restrictions made it nearly inevitable that the courts would find Trump's order unconstitutional. Judge Orrick's holding that Trump's order is not sufficiently related to the federal grants in question is debatable, although the case is strong. But it's obvious that Congress did not "unambiguously" make clear that the grants in question were conditioned on local officials enforcing federal immigration law. The Supreme Court can revise its own precedents, but lower courts cannot — hence, Orrick had no real choice but to find that the order was unconstitutional.
Trump's response in the interview that "the language on the ban, it reads so easy that a reasonably good student in the first grade will fully understand" completely misses the point. It's not the executive branch's order that needs to be clear; it is Congress that must make the conditions clear at the time that the states and/or local governments accept the funding.
This is yet another example, then, of Trump being his own worst enemy. Multiple courts have rejected his travel bans as discriminatory in substantial measure because both Trump and his close associates have announced that the bans were intended to discriminate against Muslims. If he keeps trying to fulfill his campaign promises on immigration with rushed, half-baked executive orders, it's more likely that the courts will keep striking them down. Given how bad his objectives are, this isn't a bad thing.