Imam sheds light on the matter in his famous work of "Combat with the self" as following:
You should know that no path for the realization of divine existence can be undertaken unless one familiarizes himself with the apparent or overt form of Shari’ah.
Unless a person fully acquaints himself with the knowledge of the Shari’ah laws and follows them faithfully, the higher values of morality cannot be attained by him.
Without adhering to the apparent teachings of Islam it is not possible that the light of the Divine Knowledge could descend upon his heart, and the wisdom of the invisible, and the mysteries of the holy law be revealed to him.
After attaining this stage, the truth unveiled for him and enlightenment bestowed upon his heart, a person would act with greater observance of the manifest forms of religion.
This falsifies the claims of pseudo spiritualists, who say that the inner perfection can only be acquired by relinquishing outer accomplishments, or, that after acquiring inner excellences, necessity of observing outward forms does not remain obligatory.
This is a mistaken conception born of ignorance about the stages of worship and the different grades of human progress.