Given that it wasn't illegal to be a member of a Communist party in the US, how did the military handle draftees who might be sympathetic to North Vietnam? Were men who were members of the Communist Party exempted from the draft? If they were drafted, how were they treated in the military if they talked positively about Communism or said that they hoped the North Vietnamese would win?
Yes, they were. People who held communist beliefs or who belonged to or were associated with communist organizations were not exempted from the draft; there were members of communist organizations in the US armed forces during the Vietnam war. Much, though, could depend on local draft boards which did not necessarily apply the same standards.
Soldiers could be discharged for 'subversive' activity, (as happened in the case of Andy Stapp, though not Allen Myers). Activities such as distributing anti-war newspapers or leaflets among GIs could lead to arrest and court-martial.
Allen Myers was a member of the Socialist Workers Party (which is actually communist, Trotskyist, Marxist-Leninist and pro-Castro) when he was drafted in early 1967. He was later charged by the army with distributing anti-war literature. A GI Civil Liberties Defense Committee fact sheet pointed out that Myers' political affiliations were known to the army at the time he was drafted:
Myers points out that he has never tried to hide the fact that he is a socialist and is against the war in Vietnam. When he was drafted in the spring of 1967, he stated that he was a member of the Young Socialist Alliance and the Socialist Workers party.
Note that 'socialist' is being used in a broad sense here; the YSA is Trotsyist, the SWP communist. Myers was court-martialled twice for anti-war activities but acquitted both times.
Among others drafted during the Vietnam war were:
In July 1966, three working class draftees, James Johnson, an African-American, Dennis Mora, and David Samas refused to serve in Vietnam and were courtmartialed. Mora was a member of the DuBois Clubs, and Johnson subsequently served as an editor of the Daily World. Their case became a national cause of draft resistance and opposition to the war within the military, although all were court-martialed and given long sentences to be served at hard labor.
Source: Brian Rubinsky, 'Working Class Internationalism: The American Communist Party and Anti-Vietnam War Activism 1961-1971' (MA dissertation, Rutgers, 2014)
The DuBois Clubs "was a national youth organization sponsored by the Communist Party USA (CPUSA)" the The Daily World was a communist newspaper (known as the Daily Worker until 1968) which merged with the People's Daily World in 1986 to become the People's World.
Dennis Mora, David Samas and James Johnson. Source: displacedfilms.com
Known as the Fort Hood Three, Johnson, Mora and Samas actually denied being members of the Communist Party, but for a reason:
If these young men were to participate in such a massive anti-war crusade, alongside with other American radicals, denying Communist Party membership was imperative. Dennis Mora stated that “he was not a member of the Communist Party, and Private Johnson and Private Samas said that they were not members of any organizations other than the Army.” For these young American Communists, avoiding Party membership was the only way that they would be able to participate fully in the anti-war movement.
Another Du Bois Club member, Allen D. Gurevitz, believed that associating with the 'wrong' organization might help him avoid the draft. He
realized that being afiliated with a group like the W. E. B. Du Bois Club might serve several purposes at once. Not only could he make a political statement, but his afiliation with a suspicious organization like the Du Bois Club might also persuade his draft board that he was unacceptable for military service.
Source: Mary Ann Wynkoop, 'Dissent in the Heartland: The Sixties at Indiana University'
The case of Andy Stapp, a member of the communist / Marxist / Leninist Workers World Party, is somewhat different in that he proclaimed himself to be a 'reformed character' when he was drafted. Once enlisted, though, he was perceived by the authorities to
openly agitate and propagandize among servicemen
In 1967, Stapp founded the American Servicemen's Union, an anti-war group which also published an underground newspaper called Fed Up which was distributed to GIs. There were many such anti-war publications with articles focusing on US withdrawl from Vietnam, better conditions for soldiers and the unfairness of the draft (i.e. the poor were more likely to be drafted).
Page from the April 28, 1971 issue of Fed Up. Source: GI Movement: Underground Newspapers
According to the Antiwar and Radical History Project - Pacific Northwest
Involvement in the distribution and production of these papers could mean disciplinary action against active-duty soldiers, so civilian support and off-base spaces were important. GI coffeehouses, like the Shelter Half in Tacoma, near Fort Lewis, were integral to the production of GI papers. Often, the coffeehouse provided a space to house printing materials and do layout of papers. At the Shelter Half, civilian staff and volunteers worked with active-duty soldiers to produce the newspapers. Activists were creative in distributing them: Shelter Half staff did drive-by drops of the Army Base, dumping copies next to base gates for their buddies inside to distribute. At Fort Carson, Colorado, soldiers folded newspapers into paper airplanes and sailed them over the walls of the army stockade to the inmates.
Andy Stapp was dishonorably discharged from the army in 1968 for 'subversive activity' but appealed:
After his appeals through military channels were unsuccessful, he filed suit against the Secretary of the Army. A judge ruled in Stapp's favor, stating that "there is not a scintilla of evidence connecting these allegedly guilty associations with Private Stapp's performance of his military duties," and the discharge was amended to an honorable discharge.
However, those with religious or moral beliefs against active combat could be excused combat service, though they had to prove these beliefs were sincere. Also, this could not be used to avoid being drafted; instead, such individuals might be assigned a non-military role (such as cook).
According to data presented in Michael S. Foley in Confronting the War Machine: Draft Resistance During the Vietnam War, almost 25% of 117 draft resisters surveyed in Boston identified themselves as socialists or communists (46% saw themselves as Democrats, 14.5% self-identified as anarchists and less than 2% as Republicans). Apparently, though, very few of the 25% socialists / communists saw themselves as committed communists. Foley observes that:
… it is apparent that this did not mean that these New Leftists were hell-bent on revolution. Actually, only about 20 percent of them felt comfortable with radical labels like"revolutionary"or"politico."Rather, more than two-thirds of Boston's draft resisters saw themselves as"activists."
I have not found any communist party members who actually served in Vietnam. Although lack of evidence is not, of course, evidence in itself, it is highly probable that they either resisted the draft or found a way to avoid it.