In chapter 5, Tom Sawyer is in church. He sits next to Aunt Polly, Sid, and Mary. He's asked to sit near the aisle,
in order that he might be as far away from the open window and the seductive outside summer scenes as possible.
Tom is not excited about sitting through church services when the weather outside is beautiful. His Aunt tries to keep him in a seat where he might focus and learn about Christianity. During the service, the church attenders sing worship songs and then the pastor prays a long prayer. Finally, he gets to his boring sermon:
The minister gave out his text and droned along monotonously through an argument that was so prosy that many a head by and by began to nod.
The people in the congregation are beginning to fall asleep. As the sermon continues, Tom remembers that he has a pinchbug with him. (He kept it in a small box.) After he opens the box, the beetle pinches Tom's finger, and he drops it into the aisle. The bug falls upside down "unable to turn over." Tom can't do much to help it or to pick it up again without getting in trouble with his aunt or disrupting the pastor's sermon.
Soon, a poodle shows up and sees the bug. It ends up getting pinched, as well:
His head nodded, and little by little his chin descended and touched the enemy, who seized it. There was a sharp yelp, a flirt of the poodle’s head, and the beetle fell a couple of yards away, and lit on its back once more.
This scene starts to amuse everyone in the church, including Tom. Eventually, the dog jumps into his master's lap; his master throws him out the church window and the dog runs off into the distance. At the end of the chapter, Tom reveals that his pinchbug got carried away, stuck to the poodle. Though he lost the beetle, he is happy that the events made church much more exciting that Sunday.