To be sure, I don't think it is wrong for a President to express dissatisfaction with a judicial ruling. I don't even think it is wrong for a President to claim that a judicial decision will lead to bad outcomes (I do think it is wrong to impugn the basic legitimacy of the legal system, as Trump has repeatedly done from assailing the "Mexican" judge in the Trump University case to referring to the "so-called" judge who enjoined the refugee ban).Just cannot believe a judge would put our country in such peril. If something happens blame him and court system. People pouring in. Bad!— Donald J. Trump (@realDonaldTrump) February 5, 2017
But it is worth unpacking exactly the argument Trump is setting up here. Now that his executive order has been enjoined and refugees and visa holders can enter the United States as they could before, President Trump wants us to hold the judge who issued the injunction (and the entire "court system") responsible if something bad happens. Based on past behavior, we can be pretty confident he would do this regardless of whether his EO would have kept out the perpetrator or not. The fact of a terrorist attack, in a world where Trump's EO isn't in effect, would demand that we impose such an EO.
Imagine, however, that the EO had remained in force unmolested, and we still experienced a terrorist attack. Would the lesson Trump would have us draw is "clearly, my EO wasn't effective in blocking terrorists and should be rescinded"? Of course not. In that circumstance, Trump would say "see -- this attack demonstrates why the ban on refugees and visits from these Muslim countries is essential!" (Undoubtedly, the exact phrasing would be far less comprehensible).
In other words: If the EO is not in effect and we experience a terrorist attack, that would prove we need the EO. If the EO is in effect and we experience a terrorist attack, that would ... still prove we need the EO.
(And, we might add, if the EO is in effect and we don't experience a terrorist attack, that would prove the EO is working and needs to be maintained).
The point is, there's virtually no set of facts wherein, under Trump's logic, we shouldn't be banning Muslims. The game is rigged, it's up to us not to play it.