American anti-war sentiment was relatively quiet during World War II. Though isolationists argued against the war early on, they became more hawkish once American soil was attacked. American communist groups initially were vocally pacifistic, but they changed their mind after Germany invaded the Soviet Union. American culture was divided if not strongly against America's involvement in Vietnam, but sentiment was remarkably homogenous in support for American involvement in World War II.
Heller did not write Catch-22 during World War II, however. It was first published in 1961, more than fifteen years after the conflict had ended. The milieu in which Heller was writing could be more accurately described as the Cold War. The conflict with the Axis forces was finite, and the goal of stopping Fascist countries from actually conquering the globe had succeeded. The Cold War was much more indefinite. It was more complicated to fight an enemy who was not on a battlefield, and it was more difficult to understand what "winning" entailed. There was a threat of perpetual conflict, viral distrust of the “enemy,” and apocalyptic destruction hanging in the air. This is when Joseph Heller wrote Catch-22, and the novel reflects the fears and neuroses of this time period more than those during World War II, the time period of the novel.
Catch-22 just predated the rampant anti-war sentiment in the 1960s and 1970s surrounding the Vietnam War. M*A*S*H* (1968) bore many similarities to the novel, mostly in how it portrayed the inanity and surreality of war. There was a popular film of the same year called The Green Berets starring John Wayne. This film was pro-war and showed a widespread desire to trust the government and the military. Even so, by 1968, something had changed. It was much easier to understand why World War II was a just war than why Vietnam was. Film and fiction began to take stances on the reasons for war and the integrity or corruption of government.
Heller was more focused on the inner workings of war and the personal interactions during wartime, not the broader picture. When characters like Clevinger defend the importance of fighting, Yossarian does not decry the fight against Hitler or question the importance of defending American soil. Instead, he says he wishes someone else would do it. Heller focuses on the self-absorption of characters and their twisted relationships instead of making broad statements about ideologies for or against war. Heller's view of war is not that it is crazy because world leaders are corrupt or because America is self-interested or duplicitous. He thinks war is crazy for the individual, no matter what the reasons. Regardless of good intentions, war is simply unbearable for people to cope with. Heller's pacifism is thus individualized rather than ideological.