If the aim of the US was to ensure that Vietnam did not end up being communist, then they had to convince the people not to become communist. What they did, in some of the most horrific ways possible, was to convince the Vietnamese people, and a lot of those in neighbouring Cambodia and Laos that the western democracies didn't care about them as people, they were just playing politics with their lives. This left the Chinese backed communists and easy road to winning the hearts and minds.
The US lost the military war because they lost the public relations war, both at home, and in the country they were trying to liberate.
If you look at later wars, Gulf War 2, Afghanistan, you could argue that they have learnt nothing. You will never win people over to your way of thinking by dropping bombs on them, that just ensures that they will never bow to your will.