The only reason any of this is happening is because the federal government refuses to fix the hopelessly broken immigration and naturalization system (which is unquestionably a federal responsibility under the Constitution). The states are taking matters into their own hands, despite having little to no expertise on these matters and highly dubious constitutional authority.
This is what you get when you allow issues to become too politicized.