Because Slave Codes allowed Slave owners to do horrible things to their slaves because according to Slave Codes, Slave owners could do whatever they wanted to the Slaves.
Slaves had few legal rights: in court their testimony was inadmissible in any litigation involving whites; they could make no contract, nor could they own property; even if attacked, they could not strike a white person.