'Modern' buildings solve this problem with windows that are either too small to climb through (such as the narrow crank windows) or with windows that do not open at all.
The difference between design which prevents suicide and design which prevents sleeping is that suicide can be prevented with unpleasant design. Homelessness is not solved with unpleasant design. Of course the underlying problem behind suicidal tendencies is not solved, however suicide could be called an unnatural desire. Sleeping is a near universal human necessity, and denying someone the ability to sleep is intrinsically dehumanizing.
I think the point about how dehumanizing unpleasant design is. I spent the night in a train station waiting for a connecting train at 6 AM the next morning. I can sleep through almost anything, and I had one of the worst nights of sleep I've ever had in my life. It was specifically designed to present almost no place to sleep. Not only did every bench have the arm rests which prevented lying down, any area of the floor that might be comfortable to lie in had a large concrete planter placed to make the area slightly too small to sleep in. Furthermore, every 15 minutes a loud recorded message indicating it was illegal to spend the night in the station unless you were waiting for a train or bus the next morning.
I once slept underneath a canoe during a thunderstorm after 45 mph straight line winds made it too dangerous to set up my tent. That was a much better night of sleep than I had in the train station.