Christians use the word "legalism" to describe the belief that rule-following is necessary for salvation and sanctification. A legalist is someone who depends upon good behavior, rather than God's grace, for assurance of their own salvation and that of other people. The Bible condemns legalism. Legalism shifts focus from God’s grace to human effort, which leads to judgmental attitudes and self-righteousness. Jesus rebuked the Pharisees for their legalistic behavior, pointing out that they appeared outwardly clean but were filled with sin inside (Matthew 23:25). Legalism results from fear and pride, causing either guilt and shame or harshness towards others. True salvation comes by grace through faith in Jesus Christ, not by works or rule-following (Ephesians 2:1–10).
Legalism often becomes obvious when a legalistic person sees bad behavior in themselves or someone else. When the bad behavior is seen in themselves, they tend to be filled with shame, regret and guilt, punishing themselves or even doubting their salvation. When they see it in others, they tend to become judgmental and overly harsh. Oddly enough, this kind of person often lives a double life, indulging secretly in sin while maintaining a shiny exterior.
Legalism is caused by fear and pride—fear, when we think that Jesus' blood is not enough to save us, and pride, when we take undue pleasure in our own morality and look down on the failings of others in order to make ourselves feel better about our own failings. We should remember that "the law was given through Moses; grace and truth came through Jesus Christ" (John 1:17) and "by grace you have been saved through faith. And this is not your own doing; it is the gift of God, not a result of works, so that no one may boast. For we are his workmanship, created in Christ Jesus for good works, which God prepared beforehand, that we should walk in them" (Ephesians 2:8–10). Legalism is pointless, as rules like "Do not handle" or "do not taste" or "do not touch" and other regulations have "an appearance of wisdom in promoting self-made religion and asceticism and severity to the body, but they are of no value in stopping the indulgence of the flesh" (Colossians 2:20-23). In the end, legalism does nothing to improve a person's moral state, and often leads to hypocrisy.