@cicerone imposter,
There were Asian Exclusion laws that created the first illegal immigrants (who were, incidentally, Asian). This law was passed with vitriolic rhetoric decrying an "invasion" of Asian immigrants who were stealing jobs, committing crimes and spreading disease.
The Asian Exclusion law was passed in the late 1800s and made permanent in the 1924 immigration Act.
These laws specifically targeting Asians were undoubtedly racist-- yet they were never ruled unconstitutional. After all, as any of the anti-immigrant folks here will tell you, "we" (this pronoun is silly in this context) have the right to decide who we want to let in.
These laws were only changed when enough Americans decided that such racism was wrong (and changed them through their elected officials) .