McCarthy might have been a pivotal figure in McCarthyism (obviously ;-) but he had nothing directly to do with the HUAC because he was a senator.
He sat on what is now the Senate committee on Homeland Security and Governmental Affairs. It was the Senate Committee on Government Operations then, which had an enormously broad remit and gave him his ability to harass and persecute anyone who worked for the US federal government. He was also more able to resist pressure because of it.