Have you ever seen the movie, The Music Man? There is something about the functioning of Maycomb as a town in To Kill a Mockingbirdthat always reminds me of the function of the town in the movie. I guess the best question to ask yourself about Maycomb's role in the book is to ask whether the plot of this story could have occurred in another kind of town. For me, the answer to that question is that it would have been a very different story.
Maycomb represents the best and worst of small-town America, in my opinion, and certainly represents the best and worst of small Southern towns in that era. As in many small towns, people are closely connected. Scout tells us, "Atticus was related by blood or marriage to nearly every family in town (5). People are more interested in the doings of others in the town because this is a source of entertainment. Scout says everyone in the town was slow-moving because there was nowhere in particular to go. There isn't even a "picture show." Church was Maycomb's "principal recreation" (9). In a town like this, racial and class divisions are clear and important, and because everyone is closely connected to everyone else, whatever anyone does becomes everyone's business. Of course, in a town like this, the close connections also provide an incredibly supportive network for people, who help one another and watch out for one another.
Now, suppose for a moment that the events in the story had taken place in New York City, or even in Atlanta, which was a fairly large city even in the time in which the story is set. People would not have been so involved with one another. They would have minded their own business. They might not have even known the names of their neighbors. Atticus would not have been paid in farm produce, the children would not have been permitted to roam at will, and nobody would have reported their activities to Atticus. A trial might not have been of much interest to anyone. The racial and class divisions would not have been as apparent, since people in large cities tend to not be as connected to one another.
Those are just a few differences that would have existed in a different setting. I am sure you can think of at least a few more for yourself. All of these differences support the idea that the kind of place Maycomb is is central to this novel.