Agreed with the posts above in terms of what causes Proctor to recant his confession, but I also believe there were other factors and details involved to bring him to this decision. By this point, remember that he has already cast aside his good name by confessing to lechery with Abigail Williams, so whether his confession to witchcraft is public or not really doesn't matter anymore, his name is ruined anyway.
What really does it for Proctor, in my opinion, is when he is under examination by the judges, and he points out that those who had already confessed of course did so because they would hang for it if they did not, and this point had almost no effect on the judges whatsoever. At this point, along with the demand for a public confession, Proctor realizes without doubt that the Court is a sham, and concerned only with its own image among the townspeople, as opposed to anything that might resemble justice.
John Proctor is only prompted to sign the confession after talking with his wife, Elizabeth. They come to a new understanding of their love, and he suddenly wants to live--something he was not interested in doing once he realized his actions caused his wife's imprisonment and possible death.
That being said, it is clear to the audience that he is falsely confessing to witchcraft because he thinks he's already a vile sinner and one more sin could not make a difference. He continues to think that until the confession process begins.
Proctor is willing to sign his own name to a lie for the reasons given above. He is not willing to implicate others, knowing full well they are innocent of these crazy charges. He is not willing to have his confession posted on the church door for all to see. He is not willing for his children to know he sold his friends to save his own life. When asked the reasonable question--if your confession is an honest one, why does it matter who sees it?--John Proctor speaks some of the most moving lines of the play:
"Because it is my name! Because I cannot have another in my life!...Because I am not worth the dust on the feet of them that hang! How may I live without my name? I have given you my soul; leave me my name!"
John Proctor, adulterer and sinner, understands that true penitence need not be public. He knows that while men may punish behavior, only God may judge the heart.
One issue Proctor has is that the judges talk about how they are going to hang his confession on the church door. Proctor realizes that the men do not want a sincere, private, spiritual confession, but a humiliating, public, court-serving confession that will destroy the Proctor name and hurt his sons.
Also, Proctor is disgusted by the mens' insistence that Proctor falsely name others involved in witchcraft.