This seems to be a common misunderstanding in the church today. I hear people say that there are two equal dangers Christians must avoid: legalism and lawlessness. Legalism, they say, happens when you focus too much on law, or rules. Lawlessness, they say, happens when you focus too much on grace. Therefore, in order to maintain spiritual equilibrium, you have to balance law and grace. Legalism and lawlessness are typically presented as two ditches on either side of the Gospel that we must avoid. If you start getting too much law, you need to balance it with grace. Too much grace, you need to balance it with law. But I've come to believe that this “balanced” way of framing the issue can unwittingly keep us from really understanding the gospel of grace in all of its depth and beauty.
Some people avoid the gospel and try to “save” themselves by keeping the rules, doing what they’re told, maintaining the standards, and so on (you could call this “front door legalism”).
Other people avoid the gospel and try to “save” themselves by breaking the rules, doing whatever they want, developing their own autonomous standards, and so on (you could call this “back door legalism”).
... Both are legalistic in this sense: one “life rule” has as its goal the keeping of rules; the other “life rule” has as its goal the breaking of rules. But both are a rule of life you’re submitting to—a rule of life that is governing you—which is defined by you and your ability to perform. Success is determined by your capacity to break the rules or keep the rules. Either way you’re still trying to “save” yourself—which means both are legalistic because both are self-salvation projects.
Taken from “The Gospel And The Law” (used by permission).