Many modern Christians have traded in legalism for spiritualism. The legalist emphasizes what you do externally. The spiritualist emphasizes your motivations, thoughts, and feelings that occur internally. Christians however, are supposed to focus on the inner and outer life.
The way to avoid legalism in Christianity is not to abandon good deeds in exchange for good motives. The way to avoid legalism in Christianity is to have good deeds with good motives, to obey God’s law out of a relational love for him.