This has to be looked at country by country. Unlike Europe, China still has a large rural, poor population. Without regulation, their population will explode, something the chinese government probably wants to avoid.
Instead of regulating their lives like they do with the child policy and making migration illegal maybe they should try improving their lives a little so they don’t need to have a ton of kids or work illegally and without services in order to get by? Who would have thunk a communist country would treat their poor workers so badly?