Miss Caroline is not only an inexperienced teacher; she is also a "foreigner" to Maycomb County. In Scout's precocious eyes, these are both marks against her first teacher.
Miss Caroline's inexperience causes her to become defensive when she discovers that Scout can read. Instead of being impressed or praising Scout, she insists that Scout no longer read at home. Of course, this does not sit well with Scout.
Later, when Miss Caroline insensitively offers little Walter Cunningham charity in front of the other students, Scout--in an attempt to assist Miss Caroline--informs her of the Cunningham family's ways. Miss Caroline does not appreciate a first grader telling her how things are done and punishes Scout.
Lee includes these incidents with Miss Caroline to satirize the flaws she had recognized in America's educational institutions. She obviously felt that students with talents and academic abilities were held back by inexperienced or bullheaded teachers and that what was taught in schools was not useful for every day life (hence, Jem's discussion about learning the Dewey Decimal System).
The author also includes the Cunningham scene to illustrate Maycomb's idiosynchracies, incomprehensible to outsiders.
Scout not only knows about everyone in Maycomb, but she isn't afraid to stand up and speak out for everyone in her class. The first thing she did that upset Miss Caroline was that she discovered that Scout knew how to read.
"[Miss Caroline] looked at me with more than faint distaste. Miss Caroline told me to tell my father not to teach me any more, it would interfere with my reading."
The second thing that caused her trouble was when she informed Miss Caroline of the Cunningham family's situation. Although she didn't mean to come embarrass her, Scout hurt Miss Caroline's feelings for not knowing "how things are" in Maycomb.
"You're shaming him Miss Caroline. Walter hasn't got a quarter at home to bring you, and you can't use any stovewood."
These were the two major events that lead to her getting in "trouble" with her teacher