We were there because the French screwed it up to begin with and then ran.
Further, it was evidently politcally expedient not to fight to win, or to win. Kennedy and Johnson chose to get us into the mess. The powers that were did not have the convictions to do what was necessary to win. Targets were chosen on the basis of political safety, not on the basis of strategical importance. The war was run on a political basis rather than a military basis. Such actions are thus doomed to failure.
Had the military been released to target the infrastructure and support elements of the NVA, and to take and hold ground, the outcome would likely have been very different. When one side practices limited warfare, while the other side practices total warfare, the side that practices limited warfare will not win, regardless of other advantages.
There was no unconditional surrender by either side in Vietnam. The U.S. was not actually defeated in battle. It was in fact military action by the U.S. that practically forced North Vietnam to the table, and into the agreement the U.S. offered. Not the other way around.
On a final note, on the did not win side of the ledger, the U.S. has Vietnam, and it appears it has recovered nicely. So, how many does YOUR country have on the did not win, or more to the point LOST side of the ledger?