This was the more principled stand, since taking the Fifth implied agreeing that simply being a Communist was a crime.
The Fifth implies that being a Communist was against the law.
One could take the Fifth without fear of implying being communist is a crime.