Vietnam mostly didn't want to be occupied by a foreign army. They resisted the occupation by Japan after WWII and when that war ended and the Japanese left they liked not being ruled over by foreigners.
But then when France got a military together they returned to Vietnam to resume where they left off with the colonialism thing they did before the war.
The Vietnamese didn't like that. They asked for US support in resisting French colonialism, because the US resisted British colonialism in the past. US wasn't going to go against France, interests in Europe took priority over interests in Asia.
So Vietnam needed an outside backer. So who do they go to.
Remember that the last foreign power Vietnam has fought against was not the US. They had a war in Cambodia and a war with China after the US left. I'm not an expert on Vietnam, but there's a whole lot more going on there than the US-Vietnam war and the propaganda around communist domino theory would have you to believe. Yeah they invaded Cambodia, but that was because Pol Pot was an insane psychopath. After the Khmer Rouge was defeated they left. Turns out Vietnam wasn't really all about spreading their version of their communist ideal, they kinda just did't want people from elsewhere telling them how to run things. Not Japan, not France, not the US, and no not even China.
The analogy between Vietnam and Ukraine is an apt one. A lot of people going around talking about domino theories and spheres of influence and talking like you're stupid if you don't understand the things coming from the brilliant mind of Henry Kissinger. Trying to make it fit into an ideological framework. It seems the people of Vietnam were too "stupid" to understand the brilliant analysis coming from people elsewhere. Ukrainians seem like they may be the same kind of "stupid" as the Vietnamese were. While everyone else is talking ideology and spheres of influence, they just go on shooting at foreign invaders. But in the end, who are the ones being stupid? The Vietnamese didn't seem very stupid from my perspective and the Ukrainians don't seem stupid either. Simple non-ideological motives are way more powerful than ideological motives.