Yeah, I believe that (assuming a functional society) the rules of our society need to be quite similar even if our morals diverged significantly. Look around the world. There have been many and varied moral codes throughout history. Yet legal codes tend to be similar on the major points.
Look at the ancient Mayans for example. They practiced human sacrifice which, from the standpoint of western morality, is an abhorrently immoral practice that demonstrates an absolute disdain for the inherent value of a human life. Nonetheless, murder was illegal in their society.
One can also imagine a society of machines with no sense of self preservation. These machines would likely find nothing immoral about destroying another machine, nor would they mind being destroyed. Yet, their society would likely have rules that a Bender unit can't just destroy a Calculon without a justification. Unless that Calculon unit is malfunctioning, it's likely performing a useful service to society (robot soap operas don't act themselves you know) and therefore its destruction is a detriment to this society in spite of the fact that there is nothing inherently immoral about the act.
Functional societies tend to have similarities in their legal codes because certain things are simply necessary for a society to function smoothly, morality or no. If you have to worry about your neighbor stabbing you dead for your wallet every time you leave the house, you will be a less productive member of society. Hence, murder is illegal, not because it is immoral but because allowing it disrupts society. It's true for us, it was true for the Mayans, and it would probably be true for my fictional robot society as well.