There are several reasons why Lee might do this. The most basic is, it shows how high passions are running. There's no reason to interrupt a trial unless you're overcome with emotion. It adds excitement. Next, it shows that Atticus is not alone, and that others know Tom is a good man and unlikely to do what he's accused of. Finally, with the judge's reaction, it shows the effort the community is will go to trying to keep order.