"Why should these people have been required to tell Congress whether they were Democrat, Republican, Nazi or Communist?"
I would presume because they were under oath to tell the truth. I could be wrong.
It was sort of like obstruction of justice. The Communist Party had been outlawed and Congress was investigating illegal activites.