Why did the FBI begin its now infamous counter-intelligence program

Why did the FBI begin its now infamous counter-intelligence program (COINTELPRO) while the US Supreme Court (in Yates) thought communism really wasn’t a threat to America? https://www.mtsu.edu/first-amendment/article/1047/mccarran-internal-security-act-of-1950