We get to know that Heck Tate is a responsible sheriff before the fateful Halloween night. He knows his own limitations enough to hand over his rifle to Atticus to kill the mad dog, and we know that the two men have a friendly if professional association: Atticus calls him "Heck," but the sheriff always refers to Atticus as "Mr. Finch"--a sure sign of respect.
After learning of Bob Ewell's death, we also find that he has a good heart, since he puts his job on the line by willing to officially declare Bob's death accidental by "falling on his own knife." He knows before Atticus that Boo is the killer, though certainly in self-defense. Boo could never be prosecuted successfully since he heroically saved the children from a drunken killer who had publicly made threats against Atticus and his family. Heck recognizes that Bob's death is a godsend to the town, and that Maycomb will be a better place without him. As Heck tells Atticus on the porch,
"There's a black boy dead for no reason, and the man responsible for it's dead. Let the dead bury the dead this time, Mr. Finch.
Heck also believes it would be a sin to drag Boo
"... and his shy ways into the limelight--to me, that's a sin. It's a sin, and I'm not going to have it on my head."
Although, technically, Heck breaks the law by declaring the killing accidental, he does it out of respect for Boo, the town, and for his own salvation.