Proctor interrupts the court because he knows the girls are lying and wishes to prove it once and for all.
At the point when Proctor interrupts the legal proceedings, the accusations have spiraled beyond anyone's controls. Abigail and the other girls are able to make claims without any substantive notion of evidence. Proctor is forced to recognize that his silence emboldens this process. He sees people like Rebecca Nurse, Martha Corey, and his own wife taken to jail as a result of his silence. Proctor's interruption is a last ditch attempt to stop this brutally unfair locomotive.
When Proctor enters with Mary Warren, he figures that he has what he needs to stop the proceedings. He wants Mary Warren to testify and speak "the truth" to the court. Proctor interrupts the trials because he believes he can counter the idea that “the voice of Heaven is speaking through the children.” He recognizes his duty to oppose what Abigail and the other girls are doing. Proctor believes that he can offset the darkness of the trials with the light of truth that Mary Warren can offer in her testimony. He fails to realize how the trial's machinery has become so intense that it devours anything, including Proctor and Mary, in its path.