Judge rules that Trump’s health secretary did not go through proper procedures when issuing declaration