I want to add to the depth of the above answer by including two important quotations that will help you understand John Proctor's thinking. The first is the source of your question. It is spoken by Elizabeth Proctor:
He have his goodness now. God forbid I take it from him!
Proctor's original decision (NOT "his goodness") is to lie in order to save himself. It is when the confession is put in writing that Proctor hesitates at his lie. But Proctor's eventual decision ("his goodness") is to refuse to lie on paper. He tears his confession to pieces. His death is imminent. HOWEVER, he has his good name back, ... his loyalty, ... his integrity. The quote above is Elizabeth, his wife, standing by her husband's decision.
Also keep in mind what Arthur Miller, himself, says about John Proctor:
John Proctor’s flaw is his failure, until the last moment, to distinguish guilt from responsibility; America’s is to believe that it is at the same time both guilty and without flaw.
In other words, it is the difference between responsibility and guilt that is important to master (especially in the context of this play). John Proctor was never able to master this. But Miller goes even further and says that America has a flaw and a failure as well, to think that guilt can exist without any flaws present.
Hale is trying to stop the killings of what he now knows are innocent people. He gets them to lie and confess to the charges because the court is letting them go. Hale sways Proctor for his own purposes. He feels that if Proctor is killed, then he is a murderer. He takes responsibility for his party in the hysteria.
John Proctor initially chooses to save his life and confess. He has a wife and children. He does not want to die for something he has not done wrong. Yet, once they want him to sign the confession he starts to doubt his decision. Proctor decides he has to hold on to what is left of his integrity and recant. He rips up the confession and accepts that he will die for it.
Proctor has been riddled with guilt, and has felt he has ruined his name by having an affair with Abby. By refusing to lie and give in to his fear, he has gained his name and integrity back. Elizabeth stands by his decision, despite Hale's pleas.