Both McCarthyism and the witchcraft accusations were perpetuated by hysteria. People were so caught up in the fear of the Communists during the Cold War (and witchcraft in Salem) that the smallest hint or accusation that one had any dealings with the Communist party (or witchcraft) would bring immediate and intense scrutiny on that person.
Many people took notes of this hysteria and used it as a way to settle grudges with old enemies. During McCarthyism, bitter politicians used it to tarnish the reputations their political rivals, while in Salem citizens cried witchcraft against those who they had felt wronged them in the past or against those they were envious of.
In both places the accusations deflected the attention away from the prime concerns of the time, such as race and gender discrimination in the United States, and the overly strict value system of the Puritans in Salem. Instead, the attention shifted toward Communism and witchcraft which was simply a mask for society's real issues.
In both cases, innocent people, who had nothing to do with withcraft or Communism, were dragged into the controversy and often convicted of crimes or had their reputations slandered over issues they knew nothing about.
The way the courts handled the accusations are also parallels. The innocent until proven guilty idea didn't ring true in either case and those accused were forced to implicate others or face jail time and a criminal record.