The Sharia or religious laws of Islam are not without their abuses, and as Muslims we have also seen the deleterious effects of legalism. Certain puritanical movements, emphasizing external conformity to the detriment of beauty have invaded our mosques and even our most sacred of shrines. This puritanical and legalistic perspective has come to represent the entirety of the religion in the eyes of popular culture in the west and it has proposed a challenge to the faith of many intelligent and well meaning people even within Islamic civilizations.
There are religions such as Hinduism, Judaism, and Islam in which a revealed law exists as an inseparable aspect and vital dimension of the tradition. It is for this reason that many people, suffering through an abuse of the law, may choose to reject the tradition altogether, either joining the ranks of the secular west or attempting to follow another religion where they may possibly encounter the same problem. I recently spoke with an older woman who after spending many years as a Catholic decided that there were too many rules such that they obscured her appreciation of the spirit. For her, religion had become a series of restrictions rather than a means of worship. Lately, she had developed an interest in Buddhism only to find after her first retreat at a Zen monastery that Buddhism was not without a legalistic dimension. For such people, and others no doubt, it is necessary to redefine the prevailing understanding of laws and rules and to view the legal dimension of religion in its proper proportion to the whole. As Zachary so eloquently stated, "the Law and a Doctrine are a part of religion and only become a problem when religion is reduced to them." They become an obstacle when, through exaggeration, they "eclipse intellection or the heart."
Esoterically, law is as you stated the natural outcome of realization. It is the ontological participation in knowledge, or virtue, which exists within the depths of one’s being and flows forth effortlessly from that source. From an exoteric perspective it is like an enclosing fortress, not closing oneself off from the good, but protecting it from evil, and providing an environment in which the virtues of the heart can bloom without the encroachment of foreign growths in the body and soul. Many people have not come to adopt the reversal of perspective demonstrated in this last sentence and it is this that may ultimately be the determining factor of whether or not law is perceived as something restrictive or as something liberating, for in the former attitude good may be confused with the freedom to err, while restriction may be confused with the liberation that comes by conforming to the Divine Will. Seyyed Hossein Nasr has beautifully written that
“… the grandeur of man does not lie in his cunning cleverness or titanic creations but resides most of all in the incredible power to empty himself of himself, to cease to exist in the initiatic sense, to participate in that state of spiritual poverty and emptiness which permits him to experience Ultimate Reality.”
This emptying of the self and conformity to the Divine Will is the true meaning and purpose of sacred laws.