He attended church and kept most of the rules. He was an all around good mainstream citizen. When his conscience doesn't let him rest with peace and assurance . Strict, often too strict, and literal adherence to law. Good Christians ought to be legalistic enough to obey laws.
Legalism can be eternally bad.
It is a major cause of missing salvation. Pharisaic legalism is spiritual poison. And he spake this parable unto certain which trusted in themselves that they were righteous, and despised others. The Pharisee stood and prayed thus with himself God, I thank thee that I am not as other men are, extortioners, unjust, adulterers, or even as this publican. Here is a legalist.