Answer:
After witnessing Tom Robinson's trial, Jem becomes familiar with racial injustice he was not completely aware of before. Jem is sad because of the outcome of the trial, but also because of the deep prejudices against black people present in Maycomb. During a conversation with his sister (Chapter 23), Jem says:
"I think I’m beginning to understand why Boo Radley’s stayed shut up in his house all this time..it’s because he wants to stay inside."
He believes Boo Radley does not want to come out of his house because he does not want to be a part of this cruel society, where people are being discriminated against because of their race.