The judge said the Trump administration didn't provide a "reasoned explanation" for why it approved a federal permit for the project.