A Sordid Plot
It was during this visit to Jerusalem that Jesus dealt with a certain woman of evil repute who was brought into his presence by her accusers and his enemies. The distorted record you have of this episode would suggest that this woman had been brought before Jesus by the scribes and Pharisees, and that Jesus so dealt with them as to indicate that these religious leaders of the Jews might themselves have been guilty of immorality.
What really happened was this: Early the third morning of the feast, as Jesus approached the temple, he was met by a group of the hired agents of the Sanhedrin who were dragging a woman along with them. As they came near, the spokesman said: “Master, this woman was taken in adultery—in the very act. Now, the law of Moses commands that we should stone such a woman. What do you say should be done with her?”
It was the plan of Jesus' enemies, if he upheld the law of Moses requiring that the self-confessed transgressor be stoned, to involve him in difficulty with the Roman rulers, who had denied the Jews the right to inflict the death penalty without the approval of a Roman tribunal. If he forbade stoning the woman, they would accuse him before the Sanhedrin of setting himself up above Moses and the Jewish law. If he remained silent, they would accuse him of cowardice. But the Master so managed the situation that the whole plot fell to pieces of its own sordid weight. ~ The Urantia Book, 162:3.1