Tom flees because he has already been let down by the justice system once and has absolutely no faith that an appeal will do him any good. The reality that he will "get the chair" looms large.
When the news comes, Atticus explains to Aunt Alexandra (Ch 24): "They shot him...he was running. It was during their exercise period. They said he just broke into a blind raving charge at the fence and started to climb. Right in front of them...". Atticus continues, "We had such a good chance. I told him what I thought, but I couldn't truth say that we had more than a good chance. I guess Tom was tired of white men's chances and preferred to take his own."