It's not like the laws are simply "you can't make semiconductors here". The laws ban the harmful externalities of the process. The companies that want to make semiconductors don't want to find a way to make the processes less harmful: it's cheaper and easier to just go somewhere where they can pollute instead.
There's a large middle ground between "Build absolutely nothing anywhere near anyone" and letting blatant polluters turn your neighborhood into a Superfund site. California solved the latter problem by going too far in the other direction.
https://en.wikipedia.org/wiki/List_of_Superfund_sites_in_Cal...
https://www.epa.gov/superfund/search-superfund-sites-where-y...