The US entered the Vietnam War in an attempt to prevent the spread of Communism.
Communism is a very attractive theory, particularly for the poor masses of a developing country. Imagine a society where nobody is better or richer than you are, where everyone works together and shares in the products of their labor, and where the government creates a safety net of guaranteed employment and medical care for all.
Of course, as we have seen, Communism doesn't work this way in practice. The political leaders are always much better off than the people, and ordinary workers don't produce as much when they won't get to keep the benefits of their extra hard work.
On the home front, beginning in 1949, fear of domestic Communists gripped America. The country spent most of the 1950s under the influence of a Red Scare, led by the virulently anti-communist Senator Joseph McCarthy. McCarthy saw Communists everywhere in America, and encouraged a witch hunt-like atmosphere of hysteria and distrust.
Internationally, following World War II country after country in Eastern Europe had fallen under Communist rule, as had China, and the trend was spreading to other nations in Latin America, Africa and Asia as well. The US felt that it was losing the Cold War, and needed to "contain" Communism.
It was against this backdrop, then, that the first military advisors were sent to help the French battle the Communists of Northern Vietnam in 1950. (That same year the Korean War began, pitting Communist North Korean and Chinese forces against the US and its U.N. allies.)
The French were fighting in Vietnam to maintain their colonial power, and to regain their national pride after the humiliation of World War II. They were not nearly as concerned about Communism, per se, as the Americans. When it became clear that the expense in blood and treasure of holding on to Indochina would be more than the colonies were worth, France pulled out in 1954.
The US decided that it needed to hold the line against the Communists, though, and continued to send increasing amounts of war material and increasing numbers of military advisors to the aid of capitalist South Vietnam.
Gradually, the US got pulled into an all-out shooting war of its own with the North Vietnamese. First, military advisors were given permission to fire back if fired upon in 1959. By 1965, American combat units were being deployed. In April of 1969, an all-time high of over 543,000 US troops were in Vietnam. A total of more than 58,000 US troops died in Vietnam, and over 150,000 were wounded.
US involvement in the war continued until 1975, shortly before the North Vietnamese captured the southern capital at Saigon.