Luther was excommunicated from an Apostate New Testament church. He, Luther, and many many others were appalled by the numerous false doctrines, such as the papacy, indulgences, the sinless virgin Mary and praying to the martyrs and multiple others. Just because Luther left a church in error doesn't, by any means, make him right.
Believing and obeying God does in NO WAY EVER constitute a "works" based salvation.
When we are told by His inspired word that we must be baptized to be saved He meant just that.
He that believeth and is baptized shall be saved; but he that believeth not shall be damned.
Mark 16:16
No one here, or on Earth has the mind of God to say He didn't mean exactly what He said.
No one here, or on Earth, has the authority to ignore or make null and void even one syllable He spoke. Man does not have it within him to please God without His guidance.
There is a way which seemeth right unto a man, but the end thereof are the ways of death.
Proverbs 14:12
He that hath my commandments, and keepeth them, he it is that loveth me: and he that loveth me shall be loved of my Father, and I will love him, and will manifest myself to him.
John 14:21
Being obedient to God is imperative to pleasing Him; it was that way in the Garden of Eden and it is the same today.
In Him