1. Atticus wants to do the right thing in front of his children. He mentions the fact that he could not ask them to live with strong morals if he could not do the hard things himself. He knew and understood the world his children would be going into in terms of racial tension, and this was also his opportunity to influence them to take the next steps in their generation's lifetime.
2. It was the right thing to do period. Defending an innocent victim with all the fervor and ability he possessed was not just a good thing to do, it was his job as the public defender. Atticus was not racist, and had no reason to deny the case.
3. Atticus is cited to be a Christian man in many places in the text. Besides being a church-goer, Maudie calls him a Christian man who the town calls upon to do right on behalf of them. Even though much of the town would be mad at him, those who hoped for future change needed the character of a God-fearing man who would treat Tom without prejudice.