Republican lawmakers in more than 20 states are looking to punish officials who defy Trump’s immigration crackdown.