Tom represents the scapegoat that the townspeople need in order to justify the somewhat abhorrance they have of the Ewell family. By addressing Mayella's claims of rape by a black man, the townspeople can do the minimum required by law in order to sleep at night.
The character of Tom Robinson serves several functions. First, the Robinson trial provides the conflict and suspense to drive the plot of the book forward. Everyone in the town is involved in or is following the case, and the trial allows Lee to pull together diverse groups of characters into one courtroom.
Second, Tom's character reflects the dangers of white racism. He is a generous, caring person, but he does not stand a chance for a fair trial because of his color. His kindness to Mayella Ewell is repaid with an accusation of rape.
Finally, Tom, along with Boo Radley, is the best example of a "mockingbird" as referred to in the title. Atticus tells his children that "it's a sin to kill a mockingbird" because they cause no trouble and only bring happiness with their singing. Tom ultimately becomes a "mockingbird" after he is shot trying to escape prison.