The following quote is from

Knowing God’s Purpose For Your Life (J. I. Packer)

Legalism is a distortion of obedience that can never produce truly good works.

Its first fault is that it skews motive and purpose, seeing good deeds as essentially ways to earn more of God’s favor than one has at the moment.

Its second fault is arrogance. Belief that one’s labor earns God’s favor begets contempt for those who do not labor in the same way.

Its third fault is lovelessness in that its self-advancing purpose squeezes humble kindness and creative compassion out of the heart. Legalism puts our relationship with God in jeopardy and, by stopping us from focusing on Christ, it starves our souls while feeding our pride. Legalistic religion in all its forms should be avoided like the plague.