The U.S. risks turning into a nation where visas and green cards are not legal statuses but political litmus tests.