The U.S got involved in both the Korean war and the Vietnam war because of their Communist ideas. The U.S at the time had a goal to contain the communist countries of Vietnam and Korea. The U.S government stepped in so they could stop Communism from spreading to other countries around the world. A great example of this is when Communist North Korea started to push into South Korea.
The overall goal of the Americans stepping into the whole situation was to try to contain these communist countries. The Americans feared that the communists would spread into other countries.