Lee uses the innocence of the children to highlight the racism with which Tom Robinson is treated. When it comes to courts and trials, Jem and Scout are more worldly and wise than Dill, because Atticus is a lawyer. They've learned from him some of the ins and outs of how a courtroom operates and how a lawyer handles a witness.
Dill, however, to whom this is all new, reacts emotionally to the arrogant and bullying way the prosecuting attorney, Mr. Gilmer, treats Robinson. Gilmer is trying to emphasize to the all-white jury that Robinson is a black and, therefore, both beneath contempt and guilty as charged. Not yet having internalized the racist norms in his society, Dill full feels the cruelty of Mr. Gilmer's questioning. When Scout takes him outside, Dill explains that Mr. Gilmer's speech was "hateful." He says that Mr. Gilmer "sneered" at Tom in a way that made him "sick."
Lee wants her readers to take away distinct ideas about how the two lawyers behave and how the trial is weighted against Tom. Through the intensity of Dill's reaction, she is able to make sure readers don't miss how scornfully Robinson is treated, an indictment of the way Maycomb white people in general treat their black neighbors.
It was just him I couldn’t stand. ... That old Mr. Gilmer doin‘ him thataway, talking so hateful to him—.
The way that man [Mr. Gilmer] called him "boy" all the time an‘ sneered at him, an’ looked around at the jury every time he answered—.
The sensitive Dill cries in the courtroom because Mr. Gilmer, the attorney for the prosecution, questions Tom in a such a cruel and devious manner that it clearly indicates his racial bias.
When Tom Robinson is on the stand, Atticus asks him questions in the same manner in which he speaks to the Ewells or anyone else. However, when Mr. Gilmer takes his turn at interrogation, he abruptly begins without addressing Tom, and he simply calls him "Robinson" at the end of his question:
"You were given thirty days once for disorderly conduct, Robinson?" asked Mr. Gilmer.
"What'd the n****r look like when you got through with him?"
"He beat me, Mr. Gilmer."
After this disrespectful questioning, Mr. Gilmer badgers Tom with insulting questions, insinuating remarks, and demeaning epithets, such as "boy":
"Had your eye on her [Mayella] a long time, hadn't you, boy?"
Then, when Tom naively says that he felt sorry for Mayella, Mr. Gilmer purposely twists the meaning of Robinson's words by inflection to make them sound as though Tom feels himself superior to Mayella--a serious social error in the Jim Crow South:
"You felt sorry for her, you felt sorry for her?"
No one among those seated on the ground floor likes Tom Robinson's response, especially after Mr. Gilmer stresses certain words. Too late, Tom realizes the implications of what he has innocently stated. After this, he becomes very nervous as Mr. Gilmer persists with his near-badgering of the witness. It is then that Dill starts to cry, and is unable to stop. When his sobs become audible, Reverend Sykes suggests that the children go downstairs and leave the building.
Once outside, Dill explains that he is sick of Mr. Gilmer and his "hateful" way of talking to Tom. When Scout tells Dill it is Mr. Gilmer's job to cross-examine, Dill counters,
"I know all that, Scout. It was the way he said it made me sick, plain sick." [sic]...."The way that man called him 'boy' all the time and sneered at him, an' looked around at the jury every time he answered--...Hasn't anybody got any business talkin' like that--it just makes me sick."
This is one of those cases in which the old phrase "out of the mouth of babes" comes to mind. That is, it takes the innocent perception of a child sometimes to perceive wrongs that others do not. Thus, the sensitive Dill intuitively realizes how vituperative and disparaging Mr. Gilmer is toward the innocent Tom Robinson, one of the "mockingbirds" of Harper Lee's novel. Obviously, Gilmer has Tom already condemned in his own mind, and he hopes to sway the jury to condemn him, too, as he glances at this jury meaningfully while he questions Tom. Furthermore, he slants the tenor of Tom's answers by putting his own interpretations upon them through the use of inflection and tone as he repeats them.
The emotions of the trial are running high for everyone. Everyone in the courtroom are hot and tired, and Tom is on the stand. Atticus does his best to show everyone that there was no way Tom could have done what he was accused of doing. The prosecutor is now getting ready to cross examine Tom.
Jem, Scout and Dill, are all sitting in the balcony with the black people of the town. They have been in the courthouse everyday. The children are so convinced that Atticus is going to get Tom free. When the prosecutor starts drilling Tom, Dill's emotions start to take over. He is just a child, and to see that the prosecutor is being mean to Tom, makes Dill feel so sad for Tom. He breaks down into tears by seeing Tom treated so badly. Scout is aware of this change in Dill.
"For some reason Dill had started crying and couldn't stop, quietly at first, then his sobs were heard by several people in the balcony."
I think it is touching that the children are sitting with the black people and they are the ones who hear Dill's cries. He is showing them that he is full of compassion for this innocent man.
In chapter 19 of "To Kill A Mockingbird, the trial is in progress and Atticus is taking the testimoney of Tom Robinson, a 25 year-old black man who is married and has three children. He is trying to get the history on Tom when Link Deas jumps up and yells out that Tom has worked for him a long time and has never been any trouble at all. The judge tells Link to sit down and shut up. After Atticus gets through with his questions the prosecuting attorney begins to ask Tom questions but he talks very badly to him. He calls him "boy" and insults him. He is so mean to Tom that Dill gets really upset and starts to cry. As Scout takes Dill outside for air he says he is really sick and that it is just not right to talk to anyone the way the attorney talked to Tom.