Legalism is legalistic...
"Legalism" is yet another modern day doctrine in its rampant misapplication.
Obeying God is not legalistic.
Making exceptions within the law to provide occasions for the flesh is indeed legalistic and it is a modern day invention in how “legalism” is applied today.
For, brethren, ye have been called unto liberty; only use not liberty for an occasion to the flesh, but by love serve one another. For all the law is fulfilled in one word, even in this; Thou shalt love thy neighbour as thyself. Galatians 5:13-14
Not obeying God while at the same time claiming to obey God under the false application of legalism is a double minded extra-biblical tradition of man that contradicts God's word.
Ironically enough, legalism is legalistic by its own terms, that is in regards to how it is defined today…
And he said unto them, Full well ye reject the commandment of God, that ye may keep your own tradition. Mark 7:9
A double minded man is unstable in all his ways. James 1:8
If ye love me, keep my commandments. John 14:15
Ye are my friends, if ye do whatsoever I command you. John 15:14
We do not obey God to be saved but because we are saved. That means a true believer will obey God not with exceptions and excuses through the lie of legalism but with a fervent desire to please the One who has saved us and we do it out of sincere joy.
Even so faith, if it hath not works, is dead, being alone. Yea, a man may say, Thou hast faith, and I have works: shew me thy faith without thy works, and I will shew thee my faith by my works. Thou believest that there is one God; thou doest well: the devils also believe, and tremble. But wilt thou know, O vain man, that faith without works is dead? Was not Abraham our father justified by works, when he had offered Isaac his son upon the altar? Seest thou how faith wrought with his works, and by works was faith made perfect? And the scripture was fulfilled which saith, Abraham believed God, and it was imputed unto him for righteousness: and he was called the Friend of God. Ye see then how that by works a man is justified, and not by faith only. Likewise also was not Rahab the harlot justified by works, when she had received the messengers, and had sent them out another way? For as the body without the spirit is dead, so faith without works is dead also. James 2:17-26
Make a joyful noise unto the LORD, all ye lands. Serve the LORD with gladness: come before his presence with singing. Know ye that the LORD he is God: it is he that hath made us, and not we ourselves; we are his people, and the sheep of his pasture. Enter into his gates with thanksgiving, and into his courts with praise: be thankful unto him, and bless his name. For the LORD is good; his mercy is everlasting; and his truth endureth to all generations. Psalm 100