The US had no immigration laws for the first 100 years, during which time many of our ancestors came here. The only reason we had any immigration laws to begin with was racism against Chinese people. Now we are making up other excuses for it, based on no evidence whatsoever.
> The US had no immigration laws for the first 100 years,
The Naturalization Act of 1790 limited US citizenship by naturalisation to “free white persons” of “good moral character” - yes, it didn’t technically bar immigration from people who didn’t meet that criterion, but it reduced them to an underclass who were denied citizenship - and this was prior to the 14th Amendment, so there was no constitutional right to birthright citizenship even for their children born in the US.
The Alien Enemies Act of 1798 (still on the books but long dormant until recently revived by Trump) gave the federal government the power to deport citizens of countries at war with the US - effectively banning them from immigrating. The Alien Friends Act of 1798 allowed the President to deport any foreigner based on the President’s subjective determination that they were “dangerous”- however, it expired in 1800 and was not renewed.
In the early years of US independence, there were state laws enabling deportation of immigrants - e.g. in 1794 Massachusetts responded to the “problem” of poor Irish immigrants with a state law authorising their deportation back to Ireland, and several were actually deported under this Act. While nowadays, state-level deportation laws would surely be struck down as intruding into an exclusive federal domain, the lack of broad federal deportation statutes for much of the 18th/19th centuries left open a (since closed) constitutional space in which state-level deportation laws could exist
Even prior to US independence, British law gave the colonial authorities the power to deport people they viewed as undesirable - rarely exercised, but it legally existed - and the main reason they rarely exercised it was they didn’t get many “undesirable” immigrants turning up
Note I’m not defending these laws - judged by today’s standards they were racist and deeply unfair - just pointing out that the “first 100 years” of the US wasn’t as “open borders” as you paint it as having been
And while no doubt historically (and even today) many immigration laws have been racist in their terms, motivation, or implementation - I don’t think the idea of having some restrictions on immigration is inherently racist. Almost every country on earth (even non-Western) nowadays has laws saying people convicted of very serious crimes cannot immigrate without special permission - is it “racist” if Botswana says to someone just released from serving a 20 year prison sentence for terrorism “sorry, we don’t want you”?