Good article here by Dr. Gary Shogren on legalism. Check out his Grumpy Legalists.
Here’s a quote:
The authentic legalist lives in fear, like those folks who feel compelled to wash their hands all day long or touch the door a dozen times before leaving the house. As a friend wrote to me about this facet of legalism: it is designed to “satisfy some lower sense of security or desire to be good. It’s a behavioral pattern rather than a theological view or attempt to be saved.” It also shows a stunning lack of humility, to “know” God’s pleasure in any and every situation.