There were two main factors that caused the US to get involved in the “Space Race.” Both of these factors were very closely connected to the Cold War.
First, there was the desire for military power. During the early Cold War, one of the major issues was which country would be able to get better delivery systems for hitting the other with nuclear weapons. The Space Race came about in part because of this desire. The US and the Soviet Union both wanted to use the Space Race as a way of developing rocket technology that could be used to carry nuclear warheads.
Second, there was a desire for international prestige. Both the US and the Soviet Union wanted their side to look good to other countries. Whichever country could achieve important advances in space (first to put a satellite in orbit, first to put a person on the moon) would look as if their system was superior to the other side’s system. Thus, the Space Race was a way of trying to make it appear to the rest of the world as if the United States’s system was superior to that of the Soviet Union.
Thus, the US got involved in the Space race because it wanted to compete with the Soviet Union for prestige and for military power.