The order expanded a previous one in April that barred the Trump administration from withholding federal funding to 16 cities and counties over their local laws.

The cities and counties, which included Boston, Chicago and Los Angeles, said billions of dollars were at risk.

A judge ruled the Trump administration cannot deny funding to Boston, Chicago, Los Angeles and 30 other cities and counties because of policies that limit cooperation with federal…