I have heard a few commentators mention that this practice of allowing the “anchor baby” policy is due to a 1967 Supreme Court decision. I have not looked it up.
A 1982 decision by Leftist Justice Brannon who dropped automatic citizenship for anyone born here into a footnote of his decision. That unconstitutional footnote has cost taxpayers hundreds of billions of dollars, jobs, our American culture, and our sovereignty.