The for freedom part goes back to the founding. The primary mission of the military is to protect the homeland from invasion and occupation. Though they do other things when there is no direct threat, this is still the primary mission today. Just by their presence we remain free. Do you think if the military was abolished tomorrow that we would be free people 2 years from now?
To your examples, Vietnam was fought because communism was seen as in indirect threat to American freedom. Much the same as the goal of overthrowing Saddam Hussein was to start a ripple effect of democracy throughout the middle east. Of course with such uncivilized people, with their constant conflicts and bloodshed over religion, stability and prosperity was never realized. The thought though was that democracy and personal freedom (at least in the west) has generally caused countries to become more prosperous, civil and less threatening to other countries freedom and sovereignty.