I am strongly opposed to the implementation of morality into legal codes, too. Morality is inherently divisive, the good shall prosper under a moral legal code, the evil shall suffer. The difference between a criminal and moral degenerate becomes indistinguishable. The inherent subjectivity means that judgments will always be fundamentally arbitrary, but the sentences shall be cold, objective, and cruel (in the Hobbesian sense).
I think Rick D put it very well. The law should be a set of deontic rules, setting the scope, conditions, and limitations on the use of power between actors, both individuals and institutions.
The law should set rights, rules that say no one may interfere in an action without due process as defined in the law. The law should set privileges, rules that say who, when, how, why, and how it will paid for for some individual to be given a power that others do not have by default. The law should set statuses, defining who has what authority over whom where when why and how.
I would highly recommend to everyone interested in our constitution and how to make it ensure we enjoy human rights in space to read John Searle's Making the Social World. It talks extensively about the fundamental formal structure of deontic powers in human groups and the last chapter is a very well considered argument for why human rights, as they are largely agreed on already, are crucial for allowing social groups to function well.