The Trump administration has moved to require US states to provide information on undocumented immigrants or risk losing federal funding.