A federal judge blocked the construction of the Keystone XL pipeline Thursday, ruling that the Trump administration hadn’t justified changing President Obama’s earlier rulings.

Judge Brian Morris of the U.S. District Court for Montana, who was appointed by Mr. Obama, handed environmentalists a huge victory by saying Mr. Trump’s decision to sign the permit for the Canada-to-Texas pipeline shortly upon taking office did not have a sufficient basis.

According to a report in The Hill, Judge Morris said the State Department didn’t properly take into account the effects of global warming, the risk of oil spills and worldwide oil prices.

“The major spills that occurred between 2014 and 2017 qualify as significant. The department would have evaluated the spills in the 2014 [environmental review] had the information been available,” Judge Morris wrote.

Judge Morris also said State didn’t properly justify approving the pipeline in 2017 under Mr. Trump after rejecting it in 2015 under Mr. Obama. The Obama-appointed judge specifically called out State’s disregarding the climate change arguments against the pipeline it had made under Mr. Obama.

“The department’s 2017 conclusory analysis that climate-related impacts from Keystone subsequently would prove inconsequential and its corresponding reliance on this conclusion as a centerpiece of its policy change required the department to provide a ‘reasoned explanation,’” Judge Morris said. “The department instead simply discarded prior factual findings related to climate change to support its course reversal.”

Judge Morris is the latest jurist to block Mr. Trump’s initiatives under administrative-law rule, claiming that his officials have cut corners in administrative processes to make political decisions. His policies on immigration and travel have been hit particularly hard by this increasingly common tactic by liberal litigators.

One of those litigants in this case, the Sierra Club, cheered the decision on substantive grounds.

“Today’s ruling makes it clear once and for all that it’s time for TransCanada to give up on their Keystone XL pipe dream,” Sierra Club senior attorney Doug Hayes said. “The Trump administration tried to force this dirty pipeline project on the American people, but they can’t ignore the threats it would pose to our clean water, our climate, and our communities.”

TransCanada, which had been planning the pipeline for much of this decade, had planned to begin construction next year.