After the civil war many states passed Jim Crow laws intended to counteract constitutional amendments that granted former slaves B. citizenship and voting rights.
Many people were still very racist at the time and didn't consider black people to be eligible to have these rights.