Understand first of all that there are many "unwritten social codes" that most characters adhere to in the story (and historically would have adhered to if they were real people). Ironically, Atticus does not act like most of the other characters. His social codes are far different from the social codes of most people.
For one thing, he is the arguably one of the the least prejudiced characters in the story. He teaches his children how to respect everyone equally. One unwritten social code of that time was to respect people according to social "levels." Prejudice was not limited to race alone. It was also related to education, perceived "wealth," family relations, and land ownership. Through Atticus' teaching, Jem and Scout are able to understand and observe the differences among the different social classes, but Atticus teaches them to go against the social codes that tell them to look down on people who are different.
Another unwritten social code of that time would have told him to stay away from the Tom Robinson trial. He takes it and fights it fairly, to the best of his ability. In a way, he is choosing to follow a legal social code (one that lawyers and judges should be abiding by) to hold up the law and provide the best defense he can for his client.
On the other hand, Atticus does do a few things that would have been considered adhering to unwritten social codes. First, in the absence of a wife/mother, he hires Calpurnia, an older black woman, to take care of his kids and household matters. It was probably more appropriate to do this than to hire a white woman. He teaches his children to respect her, as well as all other adults, simply because they are older. This was a social code of the time that is no longer prominent today.
Also, he allows his sister (Aunt Alexandra) to come for a while in order to provide a maternal influence for the children. Again, it would have been a common practice to send in for family help in the Finch's situation with the trial. Finally, in the chapter where Dill shows up unexpectedly, Atticus allows him to stay. He is abiding by an unwritten social code here to provide some paternal influence for a child who does not have a relationship with a father.