The visit to Cal's church accomplishes a couple of purposes. First, it allows the children to see Cal outside the setting of their house as a surrogate mother figure. The children get the opportunity to see Cal as a respected member of their community and realize that she will defend them just as their father does. When Calpurnia is questioned about bringing white children to her church, she does not back down and demonstrates to Scout and Jem that she is proud of them and unafraid of what others think.
The scene also gives the reader a look into the African-American culture during the book's setting. When Cal describes to Scout and Jem how her son learned how to read and the measures that she as a mother and others in the church have to go through just to be educated, it opens the reader's eyes to the widespread effects of discrimination and segregation upon Cal's family and friends.
I think that through the whole incident, the children view Cal with even more awe than they did before. While Scout might have complained about Cal's strictness, it is obvious that she and Jem respect her. The visit simply increases their respect. They see that Cal must master two cultures, and that she truly does "master" them. They also see how much Cal cares for them because she is willing to risk disdain from her church friends and proudly stands up for them.
With Atticus away attending a special session of the state legislature, Calpurnia, the Finch's long-serving black maid takes Jem and Scout to her church - an act that sheds light on a number of themes in the novel: Calpurnia, or 'Cal' as she is known familiarly in the Finch household, fusses over the children's Sunday dress and cleanliness, declaring she doesn't want anyone to say that she doesn't know how to take care for her children (my emphasis). In a swamp of systemic race prejudice, the Finch household is colourblind. Even though Calpurnia is black, she behaves as the surrogate mother of two white children themselves untouched by racism. Later, as Jem and Scout enter First Purchase Baptist Church, they encounter a foil for Calpurnia, Lula, a prejudiced black woman who questions Calpurnia "bringin' white chillun' to n____r church." But moments later the children encounter Rev. Sykes, the leader of the black congregation, who hospitably invites them to take part in Sunday worship. In this, the children have an immediate encounter with the complexity of their peculiar society. As much as an innocent man, Tom Robinson, can suffer injustice simply for being black, so too can innocent children suffer the same (albeit less harsh) simply for being white. The Mockingbird represents all the innocents of Maycomb County. Their encounter with both hatred and compassion in First Purchase prepares the children to perceive the humanity of Tom Robinson. Finally, Jem and Scout are wonderstruck by the illiteracy of the congregation. That everyone can and should read is an axiom of the white society which up to this point they have taken for granted. The children's novel experience of illiteracy as a mode of racial power politics shows Harper Lee at her finest storytelling. Didacticism is not her way; Lee simply shows Jem, but especially Scout waking up to a deep understanding of their world. Perhaps this is the reason for the continuing success of the novel.
As the novel develops, Jem and Scout become increasingly aware of the hierarchy of social distinctions in Maycomb and struggle to figure out where everyone has been "placed," as opposed to where everyone truly belongs. Aunt Alexandra muddies the waters for them quite a bit with her talk of family history and "fine folks," but Atticus helps them untangle that later.
Jem and Scout are well aware that "colored people" play a role in Maycomb, but their knowledge and understanding of racism is nonexistent in the beginning. What they see in their town is simply the norm; that's just the way things are, and everybody seems happy enough as they go about their business.
Jem and Scout's visit to Cal's church makes them aware for the first time that a parallel universe exists within Maycomb. They realize that an entirely different daily life goes on below the surface of theirs. This new awareness contributes to their growing up as they leave the security of the known and venture into the wider world, and surprisingly, there is a wider right there in Maycomb. Throughout the novel, Jem and Scout lose their innocence in steps, some seemingly small and benign (like going to church with Cal) and others huge and ugly, such as coming to grips with Tom Robinson's fate.