At the end of Chapter 19, Dill begins to weep after seeing the way the prosecutor, Mr. Gilmer, questions Tom Robinson while Tom is on the witness stand. Mr. Gilmer began to "talk down" to Tom as if he were inferior while he was questioning him. When Scout asks Dill why he was crying, Dill says, "That old Mr. Gilmer doin' him thataway, talking so hateful to him----" (Lee 265). Scout tries to explain that it was Mr. Gilmer's job to talk to him that way, but Dill says that he got sick of hearing Mr. Gilmer call Tom Robinson "boy." Dill says,
"It ain't right, somehow it ain't right to do 'em that way. Hasn't anybody got any business talkin' like that---it just makes me sick." (Lee 266)
The second part of your questions asks, "Why did the three kids leave?" This is confusing because during the trial only Scout and Dill leave the courtroom, which means only two kids left. If you meant to ask, "Why did the two kids leave?" this would be your answer: Jem makes Scout take Dill outside because he begins to weep. When Dill and Scout walk outside, they have a conversation with Dolphus Raymond. Dolphus gives Dill some of his Coke, which Dolphus conceals in a paper bag. Dolphus explains to Scout and Dill why he chooses to feign alcoholism. He also tells the children that as they grow older, they will become used to seeing black people treated unfairly. Dolphus tells the children his "secret" because they are innocent and can understand him.
If the second part of your question is written correctly (Why did the three kids leave?) this would be your answer: Jem, Dill, and Scout leave the courtroom in Chapter 21 after Calpurnia gives Judge Taylor a note from Alexandra asking where the children are. Mr. Underwood speaks up and tells Atticus that the children have been sitting in the colored balcony since 1:18 pm. Atticus tells them to go home with Calpurnia and eat supper. They go home and eat, then come back to the courthouse to hear the final verdict.