It is a multi-pronged issue. Cities are generally desirable places to live for most social animal types, like humans. There is the ever popular nightlife thing, a variety of interesting other activities, lots of jobs, and funky little stores that specialize is just about anything you can think of. Cities, by nature, strive to make themselves attractive to people.
One effect of this is a general tendency toward gentrification. This here one neighborhood used to be so cool, then its coolness became noticed by those looking for economic opportunities, now it is all filled with shiny, expensive condos and upscale businesses, and all the hipsters who made it a cool place have moved on to the next neighborhood over, to repeat the cycle.
Gradually, the city grows increasingly inaccessible to the very people who made it interesting, becoming a wasteland of polished gentry, with a few “undesirables” living on the fringes, and the new residents no longer have a clue about what really makes a city livable. And those homeless people are attracted to the city for the same reasons as the gentry were: there is more opportunity there.
Some cities have discovered that the most cost-effective way to deal with the homeless is to give them digs no-questions-asked. It gets them off the streets, reduces general crime and misery, and provides a leg up on their way to becoming stable, contributing members of society.
Of course, doing this runs up against the gentrification tide. “Wait, I am paying $1200 a month for this little studio while that guy over there gets a decent room gratis? What the fuck?” It ends up being a conundrum that is hard to resolve: the paying residents can step over sleeping bums and clean the human shit and piss off their shoes, or they can resent subsidizing the otherwise-homeless. It is a no-win situation — or they can move to a pleasant small town or a crackerbox palace in the suburbs.
Of course, the non-liberal cities have the formula down: just have the police beat up and/or jail the homeless until they get fed up and move on to a city that does not shit or their heads. One way or the other, someone ends sys dropping tends in unsanctioned places.