On the way to town that morning, Jem and Scout had passed Mrs. Dubose's place, and she was sitting on the front porch. As they passed, she starting hurling insults at them, criticizing them and Atticus. She was pretty rude and caustic; one of the remarks centered around Atticus being a "nigger lover," for taking the case of Tom Robinson. Jem was furious. Normally, he took her comments in stride and brushed them off (she always insulted them when they walked by), but that was too much for Jem. On the way home, when she was inside, he destroyed her flowers in revenge.
Atticus made him go to her house and read to her every afternoon until she died. It was an interesting punishment, to be sure. It might seem a bit drastic, but Atticus was trying to help Jem to see what a strong, "brave lady" she was as she fought against her addiction. Atticus was all about seeing beyond people's exteriors, and looking at them for who they were on the inside, and that is the lesson that he wanted to teach Jem.
I hope that helped; good luck!
I definitely believe that his punishment was fair. He had viewed her as a mean and nasty old woman. The act of having to read to her, to go and interact with her, humanized her and taught Jem a lesson in compassion toward his fellow human beings that transcends the boundaries of age differences. When he sees what she suffers through, what her limitations are, he begins to understand her as a person, not a mean old lady. This is a direct parallel to our understanding of Boo. Boo is different, he is mentally challenged, but he is not a monster. So many of the monsters in our world vision are made as such because they are different from us so we view them through a lens of fear. A healthy dose of understanding and sympathy can go a long way toward making us better humans.