Why were Chinese immigrants treated badly in the United States in the 1800s?
The Chinese were treated badly during the nineteenth century for two primary reasons: fear of economic competition and racism/xenophobia.
During the nineteenth century, the United States' economy experienced cycles of marked booms and busts. At the same time, the settling of the West and the need for labor to build industry and infrastructure projects made immigration a necessity. During economic bust cycles, when there were fewer jobs than available workers, this often led to animosity toward immigrants. Immigrant laborers, especially the Chinese, were disliked by more settled workers, as the settled workers feared that the Chinese would work for far less money in far worse conditions, making it more difficult to maintain a comfortable standard of living.
When this combined with racism, it created an environment in which the Chinese were not well-treated and were ultimately banned from immigrating to the United States through the Chinese Exclusion Act of 1882.
There were two main reasons for this.
First, there was an economic aspect to this treatment. American people felt that Chinese immigrants were coming in and taking jobs away from them. This feeling was especially strong during economic hard times.
Second, there was certainly a racial aspect to this treatment. All major waves of immigrants were treated at least somewhat badly, but the treatment of Chinese was worse than others. This is because Chinese were seen as racially inferior to all types of white people.
For these reasons, Chinese were treated badly and further Chinese immigration was banned in 1882.
Around the late 1800's the civil war had end and the economy was heading into a depression. Jobs became few and wide spread. Imagine the surplus of men after getting out the army that secured them with pay now they were alone without as much as a penny. Then imagine those who depended jobs that were need for the war would now no longer be necessary. So there were not too many jobs for either of the groups of people. And many began to turn their frustrations to the Chinese because they saw them as threats to job opportunities. Because of this tension there was law called the Chinese Exclusion Act the prohibited the Chinese from immigrating to the US.