The primary reason was television. The visual (and visceral) impact of the Vietnam War was the most extreme in American history because the television brought it into everyone's living room every night. When Walter Cronkite, the "most trusted face" in the US, said on the evning news that the war was lost people believed him.
The results of the 1968 Tet Offensive did not bear this out. It was an all-out, committed effort by the Viet Cong and People's Army to end the war at once, and it failed miserably. The VC were almost completely destroyed by their losses; VC afterwards were PAVN (North Vietnamese) regular soldiers in disguise. The South Vietnamese Army, cut off from their usual American support, actually fought well, showing themselves equal to the northerners. In Hue, described in Western media as "the ancient imperial capital" (a city built only in the 18th century), the damage was described by an American officer as, "We had to destroy the city in order to save it." In reality, there were only small areas of the city destroyed, minor damage compared to any city in Europe in the Second World War.
In Hue, also, the Viet Cong lost their support among the middle classes and intelligentsia. The very people who welcomed them (intellectuals, college professors, teachers, the educated and liberal part of Vietnamese society) found themselves on pre-prepared death lists. Most were executed by the VC during their occupation, as well as many young people of near military age, government workers and soldiers on leave from the SVN forces and their families. They were of course on leave because both sides had previously agreed to a truce during the Lunar New Year, during which the offensive was launched ("Tet" being that holiday).
One thing that swayed American opinion against the war was the famous film clip (and photos) of the Hue police chief shooting a VC prisoner in the head, while the prisoner's hands were bound. What the news media failed to emphasize was that the police chief had just been informed that his wife and children had been found murdered by the VC. Unjustifiable as the execution of a POW was, it becomes understandable.
General Westmoreland was, however, thoroughly fooled about Khe Sanh. While expending vast amounts of ordinance on the areas around the Marine fire base, believing that several divisions of the PAVN were massing for a "final offensive" there in emulation of the 1954 victory over the French at Dien Bien Phu, most of the manpower of those divisions were actually in Hue. Vo Nguyen Giap, commanding general of the PAVN, used American fears of "a second Dien Bien Phu" to tie down the Marines in the mountainous border area, leaving his troops free to infiltrate further south through the same cavern systems and mountain passes their ancestors had used in the thousand-year war against China and against the French. It also ate up enormous quantities of airpower, bombs, artillery, etc. on nearly nonexistent targets.
The Tet Offensive of '68 looked a lot worse for the Southern forces and America (and allied) troops than it actually was, but appearances are what matter on television. And, in the end, it didn't matter anyway. As long as the government of the South was so corrupt and riddled with traitors there was no way to "win" that war. The tide of Vietnamese history was with the northern forces, and had been since before the Americans arrived.