Atticus tells Scout he's defending Tom Robinson for several reasons. Among other things, he has a good character reference: "He's a member of Calpurnia's church, and Cal knows his family well. She says they're clean-living folks" (86). He knows and trusts Cal, so he takes her word as gospel.
Then he says, "If I didn't [defend Robinson] I couldn't hold up my head in town, I couldn't represent this country in the legislature, I couldn't even tell you or Jem not to do something again" (86). But what does he mean by this? What could his choice to defend Robinson have anything to do with whether he could never tell Scout and Jem to do something ever again?
Atticus is a man of honor, who does what he must, as he admits to Scout, even when he cannot win ("Simply because we were licked a hundred years before we started is no reason for us not to try to win" (87)). He expects his children to only respect people who deserve their respect, and he knows that if he walks away from this case, knowing that defending Robinson is the right thing to do, he will have lost his honor and when the children are old enough to understand the history of the events that led to it, he will have lost their respect.