There's obviously a morale factor at play for America and Russia to want to be the first to put a man on the moon. JFK commented that "We choose to do [this] not because it is easy, but because it is hard."
However, it seems to me that each of the two superpowers must have had other reasons for wanting to do this - "just because we can" is rarely a strategy undertaken by a government in time of war.
Was there a desire to do this, on either side, for larger technological/economic/military reasons? How did winning the space race factor into each countries' Cold War strategy?
How do you get a man to the moon? It takes a lot, but it most certainly requires a very big rocket.
This is a component of the Space Race that is, for whatever reason, not highlighted in the standard American narrative. At least, I was taught in high school that the Soviets started the space race by launching Sputnik into orbit, which compelled the Americans to start their own space program that culminated in the Apollo 11 mission. The implications seems to be that the United States just did not like that the Soviets had bested them in space; the real fear, however, stemmed not from the Sputnik 1 satellite, which did nothing but send out a radio signal, but from the rocket that had put it into orbit. When the Soviet Union launched Sputnik into space, it announced to their citizens, to the Americans, and to the world in general that the Soviet Union was now more capable at launching payloads (including nuclear payloads) than the Americans.
The United States had gone from owning a nuclear monopoly at the end of the Second World War, to seeing the Soviet Union first detonate its own nuclear device in 1949, to realizing in 1957 that the Soviet Union had developed an intercontinental delivery method that the United States did not possess. The hard- and soft-power implications of this were enormous. In terms of real power, the Soviet Union had a technology that it could develop into a massive armament of nuclear missiles that the United States could not yet counter. In terms of soft power, the Soviet Union had demonstrated to the world that its people and its ideology had already begun to outpace the United States in the struggle for global influence. Coupled with the fall of China to Communism in 1949 and the ensuing Korean War of 1950-1953 in which the United States failed to realize all of its objectives, this was a very scary time for Americans. The Communists seemed to be getting the upper hand.
This, of course, famously spurred the Americans to accelerate their own already existing missile program. In 1958, the Americans had launched their own satellite, and by the early 1960s, the Americans had developed the Saturn V, the largest operational rocket ever built. By the time John Kennedy became president in 1960, the United States had already closed the so-called "missile gap" that Kennedy had warned about during his campaign, and in fact the balance of power favored the United States in this regard. Nevertheless, policymakers still wanted to "win" the Space Race and assert American dominance over Soviet technology. By developing both the largest rocket ever used and the three-part space craft that the missile could complete a round-trip manned-mission to the moon after being launched out of orbit by this rocket, the United States affirmed quite definitively that it, and not the Soviet Union, could claim technological supremacy over the rest of the world.