Over several decades many whites came to view the Chinese as another threat to white racial purity. In 1880, for example, the California legislature passed a law prohibiting whites from marrying a "negro, mulatto, or Mongolian." ("Mulatto referred to someone with black and white ancestors, "Mongolian" meant Asian.) Earlier, in 1854, the California Supreme Court had overturned a lower court's ruling convicting a white man of murder on the basis of testimony by Chinese Americans. A California law declaring that "no black or mulatto person, or Indian, shall be permitted to give evidence" against a white person was said by this court to include the Chinese because they fell under the term "black person." The court explicitly said that "black" includes "all races other than Caucasian."
Here, Chinese were "black" because they weren't "white." From the court case in question:
As before remarked, there is a wide difference between the two. The word "black" may include all negroes, but the term "negro" does not include all black persons.
By the use of this term in this connection, we understand it to mean the opposite of "white," and that it should be taken as contradistinguished from all white persons.
We are of the opinion that the words "white," "negro," "mullatto," "Indian," and "black person," wherever they occur in our Constitution and laws, must be taken in their generic sense, and that, even admitting the Indian of this continent is not of the Mongolian type, that the words "black person," in the 14th section, must be taken as contradistinguished from white, and necessarily excludes all races other than the Caucasian.
Note the phrase "admitting the Indian of this continent is not of the Mongolian type." The judges in this court case, People v. Hall, had spent some time arguing that Chinese counted as Indians even if they weren't actually the same race.
When Columbus first landed upon the shores of this continent, in his attempt to discover a western passage to the Indies, he imagined that he had accomplished the object of his expedition, and that the Island of San Salvador was one of those Islands of the Chinese Sea, lying near the extremity of India, which had been described by navigators.
Acting upon this hypothesis, and also perhaps from the similarity of features and physical conformation, he gave to the Islanders the name of Indians, which appellation was universally adopted, and extended to the aboriginals of the New World, as well as of Asia.
We have adverted to these speculations for the purpose of showing that the name of Indian, from the time of Columbus to the present day, has been used to designate, not alone the North American Indian, but the whole of the Mongolian race, and that the name, though first applied probably through mistake, was afterwards continued as appropriate on account of the supposed common origin.
That this was the common opinion in the early history of American legislation, cannot be disputed, and, therefore, all legislation upon the subject must have borne relation to that opinion.
See? Chinese can count as either black or Indian, depending on how you want to prevent them from testifying against white people in court. But my favorite example of the completely arbitrary nature of racial classifications has to be from South Africa. From "Status of Asians at Issue in South Africa", New York Times, 7 February 1962, p. 2:
Racial segregation laws have confronted officials with a case in which South Africa's relations with Japan are at stake.
In another difficult case, an Asian man and a white woman who are married were accused in court of violating the republic's Immorality Act, which prohibits miscegenation and cohabitation by whites and non-whites.
In the last year the Government has devoted considerable energy to building up trade with Japan. As a result she has become an important customer for South African iron and wool. To enable Japanese business men to function freely the Government ruled that all Japanese would be officially regarded as white and would be exempt from the many laws that discriminate against non-whites.
When it became politically and economically inconvenient, Japanese were magically transformed into white people. And all those concerns about miscegenation just vanished.