By the end of the story in The Crucible, we have heard news that in other towns the truth of the witchtrials is being doubted. Along with this, the prisoners in Salem are refusing to admit to witchcraft.
Danforth and Parris are worried that a riot may break out in Salem due to the new doubts about the truth of the accusations against the prisoners. However, if Proctor were to confess two things would happen in Danforth's favor.
First, Proctor's confession would suggest that the others who have so far refused to confess are stubbornly continuing to lie (as opposed to stubbornly telling the truth). Proctor's confession would cast doubt on those who stand accused, effectively transfering suspicion away from Danforth and Parris and the court.
Additionally, Proctor's confession would allow him to live. This may help to keep a riot from breaking out as Proctor is seen to be a good person. His death may not be idly accepted by the people of Salem. If he is saved by a confession, the prospect of a riot is diminished.
If Proctor confesses to witchcraft, the trials are verified as being just and a popular uprising against the court may be avoided.
Deputy Governor Danforth rejoices when Proctor says he will confess. The list Danforth possesses contains the names of some people whose name carries great weight in the community of Salem. If those people are sent to the gallows, Parris fears there could be a riot and an attempt to close down the courts for being unjust. Danforth is pleased to hear about Proctor's confession because he believes that if John confesses, some of those others will follow suit.