To be clear, I am not asking if laws are moral, or even a good approximation for a moral system. We understand that there can be moral laws and immoral laws. For example, the law prohibiting murder is considered, by almost everyone, to be moral. On the other hand, a law that requires you to stone a woman to death for being suspected of witchcraft is considered, by almost everyone, to not be a moral law. Or there could be laws that aren't explicitly immoral, but that can be immoral in specific circumstances. For example, the law against stealing others' property, while not a bad law on its own, made it illegal for one to free slaves. So when I say something like "immoral law", that's just a shorthand way of saying that, in a specific context, the act that adheres to that law is less moral than the act that breaks that law.
What I am asking is:
Is there moral value to obeying the law that's independent of the moral value of the law itself?
Suppose we took, for example, a law that is completely amoral. Whether it's obeyed or not has no moral value whatsoever, according to whatever moral theory you subscribe. (One example might be driving through a red light in a circumstance where it's perfectly clear that you won't hit or inconvenience anybody.) Could an argument still be made that it's moral to obey that law, or immoral to disobey that law? Furthermore, if there was a law which you determined to have some negative moral value, should you obviously disobey it, or is there still some inherent moral value in "obeying the law" against which you must weigh the negative moral value of the law itself?
In the second last chapter of Peter Singer's Practical Ethics he touches upon this briefly. He offers an argument for why there's some moral value in following the law (though, as a utilitarian, he still maintains that you ought to weigh that value against other consequences of following/breaking a law). His argument, as I can best describe it (though I risk misrepresenting his argument with my flawed interpretation), is as follows:
A system of laws, where policies are put in place by elected officials and disputes are settled by people with expertise in said policy, while flawed, is better than any alternative method of being systematically moral that we know about. Because we don't know of a better alternative (though they likely exist), if we deviate from this system, we will most likely devolve to a worse system (for example, one in which disputes are settled by force). So, from a purely consequential standpoint, there is moral value in maintaining this system, even if our laws are not ideal. This system is maintained by people obeying the law and maintaining its integrity. If people disobey the law often, it will set a negative example for others and weaken people's conviction in the law itself. So obeying the law is tantamount to maintaining the integrity of this system that's imperfect but "better than the alternatives".
This argument makes some sense to me, though it feels a little weak. I'm not sure if it addresses any inherent wrongness of disobeying the law. Singer himself acknowledges that this only means that there's moral value in obeying the law if others are looking. According to this argument, if you can disobey the law without anybody knowing about it, there's no moral wrong in the disobeying of that law. (Again, this is independent of whether or not there's a moral wrong in the actual illegal thing that you did.)
I would like to know if there has been other work done on this question in the ethics literature that offers alternative answers that are satisfying.