The goals of US differed as:
A. The United States waged a defensive war to protect an ally
Explanation:
The US had entered both the wars on very separate terms and separate reasons.
One of the biggest reasons of entering the first world war was to ally the powers of Britain and France for goodwill and largely business concerns as it was being halted by Germany.
For Vietnam, the war was to save the southern Vietnam territory from the insurgents up north who were supported by the USSR.
Thus, the war was instrumental and defensive from their point of view.