For what reasons does Jem cry once he learns the verdict?
In Chapter 22 of Harper Lee's To Kill a Mockingbird, Jem's face grows "streaked with angry tears" as he declares, "It ain't right, Atticus." Prior to that moment, Jem grasps the balcony rail so hard his hands were white and "his shoulders jerked" with each guilty verdict from the jury that Judge Taylor read. The reason for Jem's reaction is he saw, just as Atticus saw, that the evidence of the case clearly indicated Tom Robinson's innocence, not guilt.
Jem begins to demonstrate how much he understands the evidence is pointing to Ewell's own guilt the moment Sheriff Tate testifies that Mayella had been bruised on the right side of her face and had bruises circling her entire neck from a strangle hold. The right side of her face could only have been bruised by a left-handed man facing her, and a man would need to be able to use both of his hands to bruise her entire neck. Atticus and Robinson understand the significance of Sheriff Tate's testimony, as evidenced by the fact that they exchange words. Jem is apparently observant and old enough to also register the significance, as shown in the fact that Tate's testimony makes Jem extremely happy.
Jem also demonstrates he understands the evidence points to Ewell's guilt during Ewell's own testimony. Atticus cleverly asks Ewell to write his name before the court to prove that Ewell is ambidextrous. Jem demonstrates his understanding of the importance of this evidence when he pounds the rail in excitement and whispers, "We've got him"; in saying "him," Jem means Ewell (Ch. 17).
The most telling moment in the trial is when, during Mayella's testimony, Atticus has Robinson stand before the court to reveal his shriveled left arm and hand, and Jem exclaims, "Scout, look! Reverend, he's crippled!" (Ch. 18). Jem can very easily deduce that if Robinson's left arm is crippled, he could not possibly have hit Mayella in the right side of her face nor strangled her with both hands. Ewell was the only one present at the scene of the alleged crime that has demonstrated the ability to use his left hand.
Since Jem sees clearly just how much the evidence proves Robinson's innocence and points to Ewell's guilt, Jem is shocked beyond belief to hear the verdict of the jury. Hence, Jem cries because he knows an innocent man has just been convicted based on racism, which is exactly what Jem means when he says, "It ain't right, Atticus" (Ch. 22).
Jem cries for two reasons: 1. His father lost the big case of defending Tom Robinson despite his stronger arguments, and 2. Jem understands the impact upon Tom Robinson and the prevailing statement of inequity and prejudice that the decision represents.
Jem has reached a state of maturity throughout the novel, and as a more insightful young man (rather than a child), he is fully aware that the guilty verdict against Tom Robinson is unjust in the extreme.
Atticus attempts to console Jem by explaining the unfairness of life. He gives him a very adult description of how things don't always turn out as we think they should, and demonstrates understanding of Jem's internal struggle.