The purpose that Reverend Hale has in asking John Proctor to recite the Ten Commandments is to test him on his degree of faith. He does not attend church regularly, is very outspoken about how he dislikes Reverend Parris, and because of this dislike, he has not had his last child baptized.
Reverend Hale is at the Proctor's home because he is investigating the members of the community to get a better understanding of the people to determine how bad the witchcraft scandal in the town really is. And, because Elizabeth Proctor's name has been mentioned in court that day.
When John Proctor is interviewed, or interrogated, he is asked to recite the Ten Commandments, and he can't remeber the commandment against committing adultery.
Irony is when the outcome is different than what is expected. It is ironic, because he has committed adultery, with Abigail Williams. He should know this commandment better than the other nine. So it is ironic, since the reader would expect him to know it, and he can't remember it.
Elizabeth knows that John committed adultery, so this moment in the play makes Proctor very self-conscious. His lack of knowledge in the faith and his lack of church attendance and the fact that he has openly criticized the Pastor of the church put him in a suspicious light.