This is the tragedy of India. The so called Shining India has not reached the poor people in the rural areas at all. They have absolutely no means of earning a living. So for survival they are forced to migrate to cities, where at least they get some work. For the sake of survival they have to accept whatever inhuman conditions they get. As per certain reports there are many people in India whose poverty is even below sub sahara levels
Your vote on this answer has already been received
Many can't afford living in rural areas because of unemployment so they migrate to cities where property rentals are high. Once a person gets habituated to living in slums and even if he makes his fortune he finds it very very difficult to live in flats where the doors of all neighbours are closed and you cannot poke your nose into your neighbours private things. Besides their are many taxes and the maintanence and water bill is high for those living in flats.