To punish more fully, just illegally withhold federal funds for whatever is most hurtful. Highways? Education? Healthcare?
And to your direct point, I’m sure someone could whip up a reason for the military to take over and shut down the sites if they don’t comply - this _is_ a national security matter after all.
Court system stops any of that? Just comply (or pretend to) with the letter of the ruling and try another barely-distinguishable but arguably different illegal method for the next few months while the gears of the court system grind.
What is _meant_ to stop the executive branch (meant to ‘execute’ the will of Congress, not just follow its own desires) going rogue is impeachment by Congress, but that seems like a far off prospect.