What is your definition of moral then? Laws, but particularly the Law described in those tradition's holy books, describe what is acceptable behavior in that society and is often associated with eternal and everlasting punishment after death for breaking them, in addition to sacraments that must be performed to be absolved of various attachments that are made to the person for their behavior.
I didn't think we were talking about "holy law" and afterlife punishment.
In that sense, I guess you're correct.
There's still lots of flaws in the theory, for instance morality has changed--slavery was not outlawed by holy laws, and seemingly was considered okay morally.
I don't personally equate legality with anything except written law enforced by people on earth, typically a government. Even in older times, "earth law" did not match "holy law." I don't think that, even at the time of its writing, the holy bible (for instance) described all immoral activity.
I'm not sure if you're just being a pedant or something, but as a for instance, it's not illegal in my US state to drink alcohol to excess in the privacy of one's home, yet a great number of people find it immoral. This can be said for some act or another throughout history--frowned upon, not illegal.
Has it? If you look at Hebrew and Christian tradition, the two are highly conflated.