Membership in the Communist Party was illegal for many years, at least insofar as government employment. Past associations on security questionnaires “Are you now or have you ever been .. blah blah” I seem to recall a blurb on the form helpfully suggesting “use additional sheets as necessary” to explain.
These prohibitions were part of several XO’s dating from the Truman era, expanded and revised. It’s my understanding, that William Jefferson Clinton rescinded these.
If Only Trump Knew! Maybe he could XO that shit right back into vogue. It sure seems the Bolshies are popping up everywhere these days. Hm.
So far as I know CPUSA membership was never illegal. There were several requirements to disclose membership that were repeatedly challenged. I believe it was eventually declared unconstitutional but Im not sure.