This scene takes place in chapter 25 when Jem and Scout are sleeping on the back porch in the summer heat. At this point in the novel, the trial has come and gone, Tom Robinson has been shot, Scout has had tea with the Missionary Society, and neither of the children are particularly interested in Boo Radley anymore.
In short, Scout and Jem have grown up a lot. When Jem stops Scout from killing the bug, then, it seems a little ironic. Normally adults kill bugs in the house and it is children who wish to save them. In this case, however, Jem's actions reference the "Mockingbird" motif. It started with Atticus' lesson with Scout on the first day of school, the idea of "walking around" in someone else's skin. Later, with his first BB gun, Jem learned he was allowed to shoot all the jays he could, but not to shoot mockingbirds because all they do is sing. Jem applied this lesson directly to Tom Robinson's guilty verdict and was never the same.
At this point in the novel, he has become a more introverted and thoughtful character. To stop Scout from killing a bug shows his struggle with circumstances he could not prevent and now that he cannot change. It is almost as if he is thinking, "Tom Robinson died innocently. The least I can do is save this bug from the same fate." This scene shows Jem's internal conflict, his anger, and his feeling of helplessness to bring about change.