Lee does this to illustrate a key point about racism in the book. Miss Gates brings up Hitler and how he is persecuting the Jews and how wrong she thinks that is. Now this is important because Scout tells Jem later that she overheard Miss Gates talking about how it was a good thing Tom was found guilty because it would teach them a lesson to remain in their place. When you go back and examine Miss Gates's initial lesson on Hitler, she tells the class here in America we are a democracy, unlike Germany, and we don't persecute anyone. Now given what Scout knows about Miss Gates's feelings toward African Americans, we can see the irony in her comments. We don't persecute anyone who is white. This is a key realization for Scout and it really adds to the theme of racism inherent in the novel.