A federal judge has blocked the Trump administration's attempt to cut Homeland Security funding from states that refuse to cooperate with federal immigration enforcement.