I learned about this last unit and if I have it correct, Mao wanted to get the peasants to side with him to defeat the Japanese invaders, so the communists gave benefits to the peasants
Black code basically means laws that ensure white supremacy. So since this law is restricting freed men (former black slaves) from being able to have and leave jobs as they choose, it becomes black code/discrimination.