The prohibition on certain journalists was a major escalation in President Trump’s war on the media, and will probably face a legal challenge.