Why did we go through all of the trouble of landing on the moon in the first place?

Why didn’t we use the money we spent going to the moon on improving the conditions of poor people here in the United States?

http://www.debate.org/opinions/do-the-accomplishments-of-the-space-program-justify-the-costs