The root of the problem is migrant workers moving into cities for slave-like labor and are commonly exploited by local residents and employers. They're offered "jobs" that are way below the legal minimum wage and are often paid under the table. They can't say no because their employers have power over them (threat to report to police, etc). In many sense, "illegal" migrant workers are not that different from "illegal" immigrants.
In order to raise the living standards of an entire area, you have to enforce issues like safe labor practice, minimum wage, vacation days, etc. Without heavy hand regulation in a developing countries, these things don't magically come at the kindness of employers. They must be forced. The developed countries all went through this stage much earlier this century (think back on all the activists who died pushing for labor rights in U.S. in early 1900s). When you have a massive population of people who are in dire situations and who don't have anywhere to turn, it's difficult to force employers to raise working standards.
It's a difficult issue. On one hand, it's pretty heavy handed and inhuman to tell a migrant worker they're not allowed to live in a city that's part of their own damn country. On the other hand, we don't want cities to race to the bottom with unsanitary and slum like conditions. What's the balance? I've no idea, but I'm glad Shanghai at least understands this is a problem instead of copying other Asian cities that have failed at this
As one grew up in Beijing and lived for 26 years, I can definitely say that comparing Hutong to Indian slum is really really ignorant. You can ask anyone in Beijing, they will tell you that many people live in Hutong is one group of the richest people in Beijing. Nearly all people live in Hutong are Beijing natives, and their houses inside the hutong are called "siheyuan" which are among the most expensive real estate in beijing. Most "siheyuan", houses inside the hutong, are build decades ago and owned by local natives for long time, and its value increases much fast than other real estates as nearly all located in the center of beijing. I just check on an agency site, the cheapest house are more than 5 million us dollar, and many are more than 10 million us dollar. only the most successful people in Beijing will buy those houses. (if you know Chinese, you can check on this site or by google translate: http://esf.fang.com/house/i34-kw%cb%c4%ba%cf%d4%ba/)
if you have ever been to, you can have a visit and talk to people in hutong, you will know how wealthy and happy like they are.
and there are also many other statements in you text are totally wrong and with groundless prejudice. No employer will threat to report to police because of work’s identity, you may again ridiculously think beijing as America. Beijing is china’s capital, more than third people there are not locals, they also don’t need any documents to go to and stay in their capital. And nowadays, most rich people in beijing are not locals, they come from all over the china.
In both of your comments, you say that someone is wrong, but don't offer any detailed examples of why someone is wrong. You state, "This is not an essay, I have no time to write too much." But this is Hacker News. If you read through many of the discussions here, many of the comments that get upvoted the most are actually essays that go into a lot of detail, logic, and evidence to explain each writer's thoughts. And those essays are appreciated because they elevate the discussion so that everyone learns something new.