Atticus confuses Scout when he says this to her, but by the end of the novel she comes to understand its deeper meaning. In chapter 10, Miss Maudie explains to Scout:
"Mockingbirds don’t do one thing but make music for us to enjoy. They don’t eat up people’s gardens, don’t nest in corncribs, they don’t do one thing but sing their hearts out for us. That’s why it’s a sin to kill a mockingbird."
The mockingbird is a symbol of innocence. This is the most important lesson Atticus is trying to teach his children, through both his words and his actions. This is also why he chooses to defend Tim Robinson. Robinson is a mockingbird because he is innocent, was not trying to hurt anyone, was simply trying to live. Atticus has to defend him because it would be a "sin" not to, but also to demonstrate what's right to his children.
This is also the famous line that gives the novel its name because it the most significant theme of the book. Throughout the course of the story, we see Scout grow from a little girl into a young teen. Through her eyes, we see both the innocence and ugliness in her town, but in the end, what the reader really takes away from her experiences is the understanding of empathy. She sees that innocence is worth protecting, not just through Robinson's case, but also through her experience with Boo Radley. She even sees some innocence in Bob Ewell's daughter, Mayella.
"It is a sin to kill a mockingbird," is Harper Lee's main message. Through this book, she communicates how beauty and innocence should never be harmed and should always be protected.