Out of the heart come evil thoughts, murder, adultery, sexual immorality, theft, false testimony, slander. There is a rather striking parallel with the modern Materialistic legalism of the TV and lifestyle magazines - obsessed with what you eat, but ignoring the big issues like immorality, idolatry, and compassion. On the one hand they make you feel guilty for being fat, but on the other they urge you to all kinds of immoral acts and idolatry in the name of self-fulfilment. There are three elements of Godly religion. They are Truth, Morality, and Right Relationship.
Legalism fails on all counts.
It is untrue, because it thinks that you can earn God's favour by obeying man-made rules. It is immoral, because it places obeying these rules above mercy and compassion. And it puts personal piety, scoring religious brownie points, above right relationships with God and others. A bitter man with no capacity for forgiveness, because he has not experienced God's forgiveness himself. He still thinks he is morally superior to Carla Tucker.