To restrict African Americans' freedom, and to compel them to work for low wages.
Explanation:
The Black Codes which were sometimes called Black Laws, were laws governing the conduct of African Americans (freed). The best known of them were passed in 1865 and 1866 by Southern states, after the American Civil War, in order to restrict African Americans' freedom, but mostly to compel them to work for low wages. Although Black Codes existed before the Civil War and many Northern states had them, it was the Southern U.S. states that codified such laws in everyday practice because of their heavy reliance on farming and agriculture.