Good morning!
So the U.S. fought in the Vietnam War mainly to try and prevent the spread of communism and related ideals, which was quickly spreading throughout Asia during that time. This was part of the Cold War era where the Soviet Union backed countries who were lining up with communism and the United States was supporting countries that opposed communism.
Hope this helps,
-Timmeh