That is a question Atticus himself seems to struggle with throughout the novel, particularly as he is assigned to defend Tom Robinson, a case he admits is lost before it even begins. Atticus works hard to live honestly, and to set an example for his children that depicts integrity. Early in the novel, Miss Maudie tells Scout during one of their evening conversations on her porch that "Atticus Finch is the same in his house as he is on the public streets," meaning he never tries to impress anyone, or cover up anything that he does. The problem Atticus runs into is that protecting his children becomes more difficult when people don't live up to his generally positive view of human nature. In the aftermath of the Tom Robinson trial, Atticus is aware that Bob Ewell has not forgotten how foolish Atticus made him look on the witness stand, but he doesn't really expect Ewell to do anything that would harm anyone. One might say that Atticus was overly naive during this period, because Ewell is thought to have been a prowler at Judge Taylor's home late one night, spits on Atticus on the street, tells anyone who will listen that Atticus is the reason he lost his WPA job, and is overheard making a comment that implies he is going to target Scout and Jem.
Because of these circumstances, Scout and Jem should probably not have been allowed to go to the Halloween pageant alone on that fateful night, but they were in what Scout called "our longest journey together. Ewell tried to kill Scout and Jem that night, and would have succeeded if Arthur Radley hadn't intervened. Atticus is determined that the truth will be told, even when he believes Jem had killed Ewell. However, Sheriff Tate forces his hand and Atticus acquiesces in covering up the truth when he realizes that it is Arthur Radley who saved his children. Covering up truth is something that goes against every grain of Atticus Finch's character, but he reluctantly agrees in order to protect the man who saved his children's lives.