The question is problematic.
The nature of the war was perceived very differently by different parties.
There is a school of thought saying it was all a huge mistake, for example:
Barbara W. Tuchman, "The March of Folly: From Troy to Vietnam" Balantine, 1984, ISBN 0-345-30823-9.
Americans tended to see it in terms of containing Communism and avoiding the "domino effect".
Vietnamese tended to see it in terms of freedom from occupation (by the French, then the U.S.), and would get help from anyone willing to help them.
The whole idea of distinguishing North from South Vietnam was artificial.
America was definitely of two minds about it, and there were opportunities to bring peace early.
There is strong evidence that the war was extended for political reasons in the U.S.
Here is part of a conversation in which president Johnson is noticing that Nixon is trying to sabotage the Paris Peace Accords weeks before the presidential election in 1968.
> We have found that our friend, the Republican nominee—our California
friend—has been playing on the outskirts with our enemies and our
friends, both—our allies and the others. He’s been doing it through
rather subterranean sources here.
> He has been saying to the allies that “you’re going to get sold out.
Watch Yalta, and Potsdam, and two Berlins, and everything. And they’re
[the Johnson administration] going to recognize the NLF. I [Nixon]
don’t have to do that. You better not give away your liberty just a
few hours before I can preserve it for you.”
So asking if the U.S. "won" or "lost" it seeems to presume that it should even have been fought.