I believe Miss Maudie's character is a type of foil to some of the craziness that takes place in the novel. She is the voice of reason and in many ways, expresses the opinions of the author, Harper Lee, herself. Maudie is a woman of integrity and is always available to impart some nugget of wisdom to Scout and Jem. For example, when Jem complains that his dad can't really do anything cool, she tells Jem that his father (Atticus) can do plenty of things, such as write an air-tight contract or legal document. When the hypocrites in town criticize her for spending too much time tending to her flowers, and she is going to hell, she explains to Scout that some people don't like anything that gives another person pleasure. She refuses to attend the trial because she says it is going to be nothing but a spectacle (Roman carnival) in which Christians were torn apart by lions. Maudie has a wonderful sense of humor, but her humorous comments are also commentaries on the foibles of the other characters or of the people in the town (for example when she defends Atticus at the missionary women's tea).
In the book "To Kill a Mockingbird" the original impression Scout has of Boo Radley is as the town boogieman. Miss Maudie is the one who sheds some light on the life of Boo and who he had been as a child. She softens Scout and the children's outlook of Boo and shows him in a different perspective. I believe her role is to help the children to become aware of another side to Boo.
Miss Maudie is also a gentle recollection of summer nights. There amid the violence of Mayella's rape and the townspeople's racist behaviors is the contradiction of the gentle summer evenings and comforts of the south.
Miss Maudie is one of the kindest characters found within the book. Even when her house is burnt down she looks on the bright side of things and she does not believe in racial prejudices. She also protects Boo and when the kids are thinking he is a myth, she tells them how he really is.