Many Americans during the mid-twentieth century probably thought that the terrifying events of the Salem witch trials were a distant memory, a footnote of history—something that could never happen again. And yet, by drawing a clear parallel between what happened in Salem and McCarthyism, which was in full swing when Miller wrote The Crucible, the playwright hoped to shake Americans out of their complacency and get them to see that history was repeating itself right before their eyes.
McCarthyism refers to the widespread investigation and persecution of alleged communists that took place after Senator Joseph McCarthy falsely claimed that communists had infiltrated the federal government. Though McCarthyism may have been an ideological rather than a religious crusade, there was certainly a quasi-religious zeal in it. This fanatical campaign against communism was characterized by its participants as a struggle between good and evil, and that's precisely what the Salem witch trials were believed to be by their no-less-fanatical adherents.
In both cases, the end product was the same: the ruination of the lives and reputations of innocent people. Arthur Miller was not a religious man by any means, and his purpose in writing The Crucible was to remind us that mass hysteria doesn't require a deeply religious or unenlightened society in order to take root. Fanaticism, and the mass hysteria to which it frequently gives rise, can just as easily develop in societies—like the US in the 1950s—that regard themselves as thoroughly modern and forward-thinking.