I was just coming here to say that lol. We were fine with violent communist dictatorships when it served our interest, just ask good old Uncle Joe.
Edit: And, of course, any functioning government at all but definitely a big one like the US is always a coalition of different interests, ideologies, and competing goals. The ratio of US motivation that's pure anti-communist ideology is never zero but it also was rarely 100%. There were people in US intelligence who worked with Ho Chi Minh before the war started and were pissed and heartbroken when we ignored all his impassioned letters about the rights of small nations to self-determination and started carpet bombing.