That's just the thing. Laws were designed to prevent categories like "biracial" from even existing. Thus, we had the "single drop of blood" rule, in which a person was legally African-American ("Negro" in the eyes of the law), if he or she had even one Black ancestor in the last few generations (it varied but often extended to great-grandparents). If one is to legally discriminate, one needs a legal distinction between persons, especially once society began to turn against cruder methods like lynching. So in the early twentieth century, a number of states that already banned interracial marriage codified such laws. Note that the rule predates statutory laws codifying it; it was used in common law for a century or more before, showing up in 19th-century cases.
Source: Winthrop Jordan. 2014. "Historical Origins of the One-Drop Racial Rule in the United States." Journal of Critical Mixed Race Studies 1(1): 98-132.