A federal judge ruled on Friday that key parts of the Pentagon’s press policy were unconstitutional.