Technically yes, but when someone's talking about legislating morality, what they usually mean is stuff like outlawing porn, other religions, blasphemy, booze, drugs, homosexuality, etc. In otherwords, victimless crimes.
There's a difference between morality and rights. Basically leaving...