Hearts are often seen as things that have a rational side and an emotional or irrational side. Courts are supposed to be completely rational but can also be governed by emotion or other irrational forces.
In this case, there are myriad examples and evidence demonstrating that Tom is innocent, but the emotion and prejudice of the town is such that he cannot get a fair trial.
As Scout supposes and others sometimes agree, the town seems to be filled with people with hearts that cannot respond to reason or rationality and are rotten with hate and prejudice. So too is the court in this case as its rational function is overridden by the emotion and prejudice surrounding the case.