John Proctor wants to save his wife and put an end to the witch trials, which are clearly held by a corrupt and shortsighted court. Innocent people are being convicted of witchcraft left and right, targeted and victimized by their political or social enemies in the village. Proctor has promised that his "purpose" in presenting his petition and bringing Mary Warren to testify against the other girls has nothing to do with "undermin[ing]" the court" and that he simply "would free [his] wife." Deputy Governor Danforth informs Proctor that Elizabeth, Proctor's wife, is pregnant, and this means that she will not be executed until after she gives birth. Danforth asks Proctor to "drop this charge" that the girls are lying, but Proctor responds, "I—I think I cannot." Here, we see his hesitation; he is conflicted by the knowledge that his own wife is safe—for now—and his desire to help his friends' wives too. He says, "These are my friends. Their wives are also accused." Proctor makes it clear that he cannot, in good conscience, walk away from his friends.
Later, when Mary Warren isn't believed and the girls are mounting another attack on innocent people, Proctor calls Abigail a "whore" and admits to his affair with her. He assumes that he will be believed because, as he says, "a man will not cast away his good name." When he admits to his lechery, he stands with a "hanging head," according to stage direction. It is clear that he did not want to have to admit his sins so publicly, but he must have felt he had no other choice than to sacrifice his reputation in order to prove Abigail's guilt and motives.