This type of discouragement was unknown to me until I moved to San Francisco. Now, I see it all over the Bay Area, anywhere there is a slab of concrete, especially when the concrete is protected from the elements. For example, a new bike/ped overpass was installed in Sunnyvale (near my work), and sure enough where the angle of the ramp leaves the bulk of concrete foundation, they placed big rocks on end, closely spaced and jutting up in an unfriendly way. I wonder, how much did those rocks cost to install? Would it have been enough to house and feed a homeless person? Consider design, materials, and implimentation.
Maybe it is about time for us to treat our homeless like humans. I see so many people on the streets of San Francisco, and I always look them in the eye, nod, and say hello. Most of my fellow San Franciscans look forward, blankly, and act as though the homeless don't exist. Personally, I don't think it would be very hard to fall on bad luck, and end up on the street. I don't think it is a choice for most of these people, who typically have serious mental problems, many of which are caused by our own society (take the homeless veterans who account for 23% of the homeless population (!) as a prime example).
Urban planners of the world, please stop installing these rocks in concrete, it doesn't fix the problem any more than the war on drugs has ended drug abuse. There is a deeper root to the problem that needs to be fixed first.