The correct answer is B. To preserve white supremacy
They were designed to prevent African-Americans from earning money and forced them to work for small wages almost as if they were slaves. They were free but the black codes severely damaged their civil rights and treated them as lesser beings.