I'm not a historian, but my understanding is that Vietnam was a failure for the US because it wasn't executed properly. Eventually, US lost heart and fled the country. The goal itself (stopping comunism from spreading to another country), was in US' interest, at least as long as US wanted to be maintain its status as a global hegemon.