Here is the answer. Firstly, it was only the business of the state and the federal government is not allowed to meddle with it. But then, later on the supreme court made racial segregation illegal. Hope this answers your question. Have a great day ahead!