There are only so many jobs. This sounds pretty obvious, but a lot of people forget it. When the Gold Rush hit, there were tons. Chinese immigrants in the 1800s were willing to take on the backbreaking labor of making the railroad, and everyone else was happy to let them.
The problems started when those jobs went away.
By the late 1800s, there were a ton of immigrants and not enough jobs to go around. White Americans wanted jobs without the competition of Chinese laborers. Enter the Chinese Exclusion Act, which outlawed immigration for ten years and installed ways to monitor any visiting workers.
The Chinese Exclusion Act used racism as a tool to enact an anti-competition and anti-business agenda. It was primarily an economic measure.
The Chinese Exclusion Act hides its racist agenda behind a veneer of concern for business. It was primarily a tool of the nativists.
A large sweep of Chinese immigration was followed by an economic downturn (these two things are entirely unrelated, too). White laborers wanted to protect their jobs from outsiders, and created enough political pressure to make that happen.
The law starts out by saying Chinese laborers constitute a danger to the United States. Yup; it just comes right out and says it. Then it says they can't immigrate for ten years.
There's only so many ways to say, "Hey, all those Chinese people who want to live and work in the U.S.? No thanks." This law tries all of them. The meat of the law is in Section 1, which is that bars Chinese people from immigrating for ten years.
The rest of it is spent on enforcement, including a system of monitoring Chinese people already in the country. It also points out how ship captains are supposed to deal with Chinese passengers, since this was before commercial air travel.
No more Chinese people can immigrate to the United States. #sorrynotsorry.