At first, Scout doesn't understand what Mr. Underwood means. Tom had "been tried openly and convicted by twelve good men and true." (Chapter 25)
Then she realizes Mr. Underwood's meaning. The men on the jury were supposed to give Tom a fair trial and they presented themselves as honest, loyal, and fair. However, they (and many other citizens in Maycomb) have continued to embrace certain social traditions, one of which is racism. Therefore, they present themselves in court as honest citizens, but that racist tendency is still hidden in their hearts. In Chapter 23, Atticus explains this human flaw to Jem:
The one place where a man ought to get a square deal is in a courtroom, be he any color of the rainbow, but people have a way of carrying their resentments right into a jury box.
The court is a public event where laws, morals, and crimes are argued. The heart (or mind) is a court of conscience where personal attitudes are argued, confirmed, accepted, and possibly changed by the individual. Every person must learn and decide their own personal views on society, ethics, and laws to live by. Therefore, the heart/mind is the personal court wherein the person decides his/her beliefs. The courtroom is the public/social version of this.