There were many reasons as to why both the USSR and the USA entered the Korean War, however the underlying reason that the Korean War erupted was because it was merely another episode in the ongoing Cold War between these two super-powers. On the surface, the Korean War seemed to be a war between South Korea and North Korea, but in actuality the superpowers were using it as a front to combat each other without actually going into a 'hot war' which - as both had the atomic bomb - would have been a scenario of mutually assured destruction.
The USA went to war in Korea for three main reasons. The first reason was the 'Domino theory'. Salami tactics in Eastern Europe was not the only place where Communists were coming to power. In the Far East, too, they were getting powerful - China turned Communist in 1949. Truman believed that, if one country fell to Communism, then others would follow, like a line of dominoes.
He was concerned that, if Korea fell, the next 'domino' would be Japan, which was very important for American trade. This was probably the most important reason for America's involvement in the war.
The second reason was just to try to undermine Communism. President Truman believed that capitalism, freedom and the American way of life were in danger of being overrun by Communism. The Truman Doctrine had been one of 'containment' - stopping the Communists gaining any more territory. In April 1950 the American National Security Council issued a report (NSC 68) recommending that America abandon 'containment' and start 'rolling back' Communism. This led Truman to consider driving the Communists out of North Korea.
Finally, Truman realised the USA was in a competition for world domination with the USSR. By supporting South Korea, America...