While it is indeed a noble thought that we can fix all the problems of the world, perhaps we need to accept that this will NEVER happen. The fact is that we NEED to develop a substantial off-world presence in order to avoid "keeping all our eggs in one basket", as it were.
I will say this. NASA's budget is about $16 billion a year. If this money were instead to be used to feed the hungry and cure diseases, I'd be all for it. Hell, they should have scrubbed the ISS and used that money for more down-to-Earth purposes; instead they have a multibillion dollar house trailer that goes around in circles and takes pictures of the weather. LEO is not where we should be focussing the efforts of the space program. But back to the main point, if we could use that $16 billion for better purposes, it would be great. The fact remains, however, that the vast majority of that money would go towards defense. Nobody with half a gram of common sense could possibly believe that the money would be used to end world hunger. As I stated before, it would be used so that the military could have a few more new fighter jets. If anyone can defend that and show me how it's better than exploring space, I'm all ears. But you can't.
In any case, this argument will soon become moot. Already, private companies are moving in on what used to be an entirely governmental area. In 50 years, I'd be surprised if NASA still existed, except maybe to act as a regulatory agency for commercial space ventures. And while people have every right to criticize how their tax money is spent, they don't have any grounds for complaining if Boeing or Scaled Composites or Google decides that they want to spend a billion dollars on an orbiting hotel or a moon base. And this is where the future is. Near-Earth is rich with opportunity for tourism; farther out there are untold quadrillions of tonnes of resources in the asteroids - the metal content of one 10-km asteroid (of which there are tens of thousands) alone could make mining on Earth redundant.
We also shouldn't forget the massive advancements in science and technology that could come from exploring space. Necessity is the mother of invention, and to explore further involves new levels of technology including more efficient power sources, stronger and lighter alloys, better computers... Eventually, it could be asteroid mining or settlement-building on Mars that drives the development of true nanotechnology - and if you really want to fix all the problems on Earth, nanotech is the place to start. Sure, this is all conjecture, but you can look at historical parallels, and even look at the technology that the space program has brought so far - I'm sure there's a comprehensive list on the internet somewhere, but off the top of my head I remember the Apollo missions giving us scratch-resistant glass and quartz watches. Sure, they may be just small, mundane things, but it's all part of our progress.
Besides, space exploration is cool. Nobody can argue with that.