Both the United States and the Soviet Union feared each other's nuclear weapons, which is understandable. They also feared a "missile gap" where the other superpower had more missiles or warheads, and so they frantically constructed more weapons to try and maintain an advantage strategically. In addition to constructing a huge arsenal of atomic weapons (the total by 1985 between both countries was a staggering 27,000 nuclear weapons), both sides built and maintained huge standing armies in preparation for what they felt was an inevitable World War III.
The Space Race seems almost silly today, when you consider that Sputnik was only capable of beeping a signal back to Earth and nothing more. But in a nuclear context, America feared that the Soviets could drop nuclear warheads from satellites without warning, so we felt it was absolutely necessary to "catch up" to the Russians in technology.
The arms race and the space race were related, but different. The arms race was a competition to have the biggest and most dangerous weapons arsenal. This was clearly important because each side was afraid of the other. They each wanted to make sure the other could not overpower them.
The space race was a competition to get into space (first in space, first in orbit, first to the moon, etc). This was related to the arms race because the rockets used for that could be used for nuclear missiles too. It was also important because both countries wanted to look like they were stronger and more advanced technolgically (if they could be first in these various competitions in space).
Arms race and space race can both be considered to be part of intense rivalry that developed between U.S.A. and U.S.S.R. after the World War II for domination of world politics.
The arms race concentrated on developing offensive and defensive equipment of war. Nuclear war heads and long range weapon delivery system dominated the arms race.
Over a period both countries realized that this arms race was doing no good to any country. As a result initiatives were taken to end the arms race. A series of meetings between the Soviet Union and the United States, took place between 1969 and 1979 in an attempt to limit the production and distribution of nuclear weapons. These meetings are called strategic arms limitation talks (SALT). Though provision of the agreements reached during these talks were never ratified by the USA, the provisions of the agreement have not been violated. So we can say that the arms race has come to an end.
Space race also became a part of cold war because success in space was regarded a measure of a country's leadership in science, engineering, and national defence. This led to the two nations competed with each other in developing their space programmes throughout the 1960's and 1970's. This race made both nations to put in tremendous efforts in their space program, which perhaps was influenced by need to demonstrate superiority rather than just achieve scientific progress.
The space race gradually faded out with realization of futility of the cold war. By the end of the 1970's, the United States and the Soviet Union began to pursue independent goals in space. Subsequently some collaborative programs in space exploration have also been taken by the two countries.