Corruption as part of the culture is an enormous part of it, especially in Africa and Asia and to a lesser extent in South America. That's a problem that you can't really throw money at because it tends to just add to the issue.
There are economic complications, too. Simply delivering food and water outside of a disaster situation undermines the local food economies: why buy food from the local farm if someone else is giving it away for free? Farms go under, leaving more people reliant on handouts.
War is another major issue. We hear about a million refugees in Gaza, but they're largely just a few kilometers from their homes, so delivery isn't that difficult. There are other cases where refugees in Iraq, Syria, and Afghanistan end up hundreds of kilometers from home, and these present bigger challenges. But in Africa, there are millions of people who have been moving over thousands of kilometers through war zones that have been akin to the areas controlled by the Islamic State for decades. No one really notices because no one reports on it. Even the Rwandan Genocide took weeks for most people in the West to notice despite on-scene reporters providing detailed reports.
There's a great deal of research going into what works. Solving economic issues is a big start. Reducing infant and childhood mortality rates by directly (i.e., not through the local government) fighting malaria with sterile releases and mosquito bed nets has helped dramatically in some locations. Teaching farmers how to more efficiently tend their crops, and opening them up to international markets has also helped.
The space program helped, too, mapping climate changes that provide hints on where to help, when to change to different crops, and how to handle desertification.
There will be no time that all earthly problems are solved so that we can concentrate on space. Trying to divert all of the money spent on it would be devastating to industry anyway, and no other nation will join in because, like it or not, we now all rely on space.