Your question seems a little confusing. I think you are asking about him revealing the truth about his past relationship with Abigail to the court. When he admits to the court that he had an affair with Abigail, his reasoning is simply to expose Abigail as a fraud. He does this in an attempt to save his wife and all of the innocent people who are being accused and condemned of witchcraft and to bring truth and justice back to Salem. This reveals that John Proctor is a good and decent man willing to sacrifice himself by exposing his own sins and crimes in order to save others.