Moral significance

If there is no law, what you do will have no moral significance.

If there is law, but you don’t have the liberty to break the law, the keeping of the law also carries no moral significance.

But if there is both a law and you have the liberty to break the law, there is moral significance in keeping the law.

There must be some kind of balance between absolute freedom and absolute constraint. The question is, what is that system? Is there a system that meets that requirement and is it possible for mankind to deploy that system among civilizations?