From the 1950's through the 1980's the driving force in american politics was fear of communist aggression and expansion. Much of that appears to have been, intentionally or otherwise, exaggerated by politicians and military for their own purposes. Most associate this with right-wing figures like Goldwater and Reagan, but Kennedy was elected, in part, due to an alleged missile gap with the Russians under the Eisenhower administration. The missile gap proved to be an entirely false accusation which the republicans could not respond due to the sensitive nature of that information.
The irony of all this is that having created a culture of fear among the public, the politicians were forced to intervene in situations such as Vietnam. They couldn't appear to be weak on communism without suffering political disaster at the hands of their opponents. The politicians were in effect trapped by their own anti-communist rhetoric. As a result, LBJ and Nixon were left with very few options in Vietnam even after they knew the war itself was becoming futile. McNamara was largely just a tool in that larger process. Someone else would have performed his function if he had never taken the job. That doesn't absolve him of his actions, but it does limit his influence on history. The news reports today indicate he was often seen walking around DC. Sort of a haunted figure. Hard to say though whether his regrets were due to his own failure or the many lives that were lost in Vietnam.