In Chapter 10, Scout recalls the time Atticus gave her and Jem air-rifles and instructed them that it is okay to shoot bluejays but that it is a sin to kill mockingbirds. Miss Maudie clarifies this point for 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.
Arthur (Boo) Radley and Tom Robinson are like mockingbirds. They don't bother anyone. And when they do interact with people, they only try to help. In short, Tom and Boo do nothing but help (sing their hearts out) and/or keep to themselves. It would be a sin to harm them and it would be right to help and protect them. Atticus takes Tom's case because it is the right thing to do (and because he knows he will do it honorably). Atticus also defends Boo when the children are making fun of him. At the end of Chapter 5, Atticus warns them to "stop tormenting that man." Atticus knows more than the children do; that Boo Radley is not hurting anyone and like the mockingbird, it would be a sin to hurt him, even by playful mocking. This is why Atticus defends Tom and Arthur.