It is important to remember that Atticus did not want to defend Tom Robinson, precisely because he knew that he could not win, and because he knew that defending Tom would create problems for his children. But having been appointed to the task, he treats the case as he would any other. The reason he gives to Scout is that if he did not, he would no longer have any moral authority over Jem and Scout, and would no longer be able to practice law or participate in the legislature. In other words, he would have compromised his integrity. It is important to realise that Atticus is not a human rights crusader - he really does very little to challenge the status quo. But within the context of that era, he was an unusually fair-minded and principled defender of the innocent.
Atticus believes in human rights. He believes everyone has a right to a fair trial and a competent defense. Atticus does not believe this should only apply to the white race. This is not to say that Atticus believes he has much hope in swaying the town or jury of Tom's innocence. Tom realizes that although he believes in equality in law, most do not. It is his integrity that pushes him to do this, even in the face of almost certain defeat.
Atticus's defense of Tom makes Scout's life at school even more difficult. Her father has been on her about fighting with her fists, yet she is being taunted for his representation of Tom Robinson. It is a difficult concept for a child to grasp, andx sh is not immediately approving of her father's choice.
if he did not defend Tom then he would not be able to tell Jem & Scout what to do anymore,he would not be able to hold his head up high in town, & he could not represent this country in the legislature.