It's just a side effect if population growth and the fact that these people had/have the wrong kinds of people in their lives.
Love literally is the answer for most problems. It's hard to love people in bad situations, bc oftentimes they made mistakes and burnt people to be in the situation at all. Not always, but often.
I read about this yesterday.
https://en.m.wikipedia.org/wiki/Pit_of_despair
Now, I can't speak on those who had it good and fucked up their lives through making terrible choices on their own, but there are a ton of people with shitty lives who got there due to having terrible people in their lives, or not enough good, loving, caring people.
Raise your kids right, and be kind to anyone and everyone, really. Don't be shitty to them. Don't be cruel to them. Love them, care for them, guide them. It won't take care of the issues humanity has today overnight, and it won't solve the problem completely bc there will always be morons in this world. But, if parents raise their children correctly and guide them and teach them how to be good people there is a much lesser chance of us having the problems this world faces today. The homeless problem, the many problems the homeless face aside from simply being homeless, we will have to deal with it for now. It won't simply vanish bc we want it to. The best way to fix it is for humanity to start instilling values and morals into their children, teach them respect, for others and for themselves, and to spend time with our children and not let them raise themselves or be raised by the media, which is a framing tool for EVERYONE. Teach them to love each other, bc we are all suffering through the same existence, even if the experiences are different. If people were born into caring, loving families who did right by their children, these problems we face today would be less frequent.
Unfortunately, humanity has reached a point where they've built their cultures on hatred toward other, being selfish and mostly not caring for others at all. It is probably too great an issue to overcome, at this point. Too many people hate others simply based on trivial shit like skin color, general appearance, political or religious affiliation, sexual orientation. Shit that doesn't truly matter. The hate culture that is present basically everywhere in the world is a direct reason for many of the problems we face directly, or even indirectly. And it starts with your experiences as a child.
Be nice to people.