During the time Miller wrote "The Crucible" it was 1952 and Senator McCarthy was conducting a "witch hunt" against any American suspected of being a communist. During the McCarthy era, people were accused of being communist based on opinions with no evidence at times. Miller could not directly blame Senator McCarthy for accusing people without proof because then they would think he himself was a communist and he would be punished. Instead, he referred back to the Salem Witch trials knowing that the same scenario was happening present-day 1950s, as it did back in the 1690s. Both of the situations matched up arguably parallel to one another due to them both having the same theme and structure. So basically Miller crafted The Crucible as an allegory to indirectly relate it to what was happening at the time and also to target Senator McCarthy without being accused of communism.
Arthur Miller crafted The Crucible as an allegory by basing his characters off of real people that went through the Salem Witch Trials. Arthur Miller was called in during the Red Scare and was asked if he ever knew any Communists that threatened America. Miller felt attacked and wrote The Crucible to show how he saw the whole incident. He compared the experience to the court cases in the Witch Trials in which people were forced to betray their friends and family.
If that isn't enough, or what you are looking for, you can finish it, but I have to go so that's all I have right now.