The purpose of law (in my opinion) is to protect the rights and freedoms of the individual while providing a framework within which members of a society can live and interact while safe, productive, and secure with as much individual autononomy as possible. Morals-based strictures that do not aid in these goals are not appropriate. For the opposite of what I'm talking about, see the Taliban.