A federal judge has struck down a Trump administration policy that made it harder for immigrants from dozens of countries to enter and stay in the U.S.