Arthur Miller wrote "The Crucible" for a variety of reasons. At the time of its release, Senator Joe McCarthy was head of a committee to question people about their relationships to Communist sympathizers and the party itself. Miller was able to convey the general idea of "witch hunts" using a metaphor. He also explored the Salem Witch Trials in popular culture, restarted his career and became overwhelmingly successful.
The overall reason why Arthur Miller wrote "The Crucible" was to protect his career. As a writer, he could have been blacklisted by the House of Representatives Committee on Un-American Activities.
By speaking out against McCarthyism, Miller was able to make a general statement about the so-called "witch hunts" that pervaded the government and Hollywood. This play helped remind people of the past and relate it to the present.
Miller was also able to convey a major historical event in a controlled manner. The Salem Witch Trials were a watershed moment in American Colonial history, with 150 people accused of witchcraft.
In 1953, when Arthur Miller wrote the play, he was talked about as one of the best playwrights ever. As such, he wanted to capitalize on his name. That year, he was awarded the Tony Award for Best Play.
After the success of "A Death of a Salesman," he followed up with "An Enemy of the People," but this play closed after only 36 performances. He needed to make his mark once more, and after three years came up with "The Crucible."