Dill is upset when Mr. Gilmer calls Tom "boy" because Dill realizes this is a disrespectful term. Tom has admitted that he helped Mayella because he felt sorry for her. In the deep south in the 1930's, whites did not feel that blacks could feel sorry for a white person. Whites felt that any white had an immediate advantage over any black person simply be being white. For Tom to admit he felt sorry for Mayella implied that he felt himself to be in a better position than her. Mr. Gilmer, in order to reduce Tom to a lower level and to put Tom in what Mr. Gilmer and most of the all-white jury would consider "his place", Gilmer uses the word "boy". This word takes away Tom's identity as a grown man; as an adult. "Boy" was frequently used by ignorant whites when referring to black men for this reason.
Dill is the one who gets upset because he realizes that the term is disprespectful. He knows that Tom was simply trying to do a good deed for someone and that Tom should be thanked, not punished, for his actions.
Mr. Gilmer calls Tom a boy to degrade him. This degradation sends an unspoken message to the jury that Tom should not be viewed as a grown man whose testimony could be trusted. Mr. Gilmer intentionally talks down to Tom simply because Tom is black and Mr. Gilmer can get away with it. Also, by speaking that way to Tom, Mr. Gilmer attempts to get Tom riled up so that he will say something he is not supposed to. Dill is upset by this whole thing because of the tension that builds, and because deep down, he sees the injustice of the way Tom is being treated, but he can do nothing about it.