Atticus directly explains his reasoning for defending Tom Robinson in Chapter 9 after Scout's altercation with Cecil Jacobs, who claimed that her father "defended niggers." Atticus "sighed" and told Scout a little about Tom: how he was a member of Calpurnia's church and that his family was "clean-living folks." Atticus warns Scout not to listen to what the townspeople may say and to hold her head high if she hears "ugly talk" about him in Maycomb. But the main reason
"... is, if I didn't I couldn't hold up my head in town. I couldn't represent this county in the legislature. I couldn't even tell you and Jem not to do something again." (Chapter 9)
It is only later that Scout discovers that Atticus has not volunteered to represent Tom: He has been appointed by Judge Taylor instead. Yet, Atticus could not turn down the appointment.
"... do you think I could face my children otherwise?" (Chapter 9)