A federal judge agreed Friday to block the Trump administration from enforcing a policy limiting news reporters’ access to the Pentagon, ruling that key portions of the new rules are unlawful.