But all sin is an attack on the idea that God has a plan for our lives and should be in ultimate control of all things. David sinned against God by showing that he didn't accept God's view of marriage or the sanctity of life. He didn't accept God's views of relationships. David, in spite of his terrible behavior, recognized this. We have seen a lot of apologies in public life recently.
Apologies are good.
David should have apologized to Bathsheba, Uriah and the nation for his actions. When we sin against another person, we need to apologize to them as well as to God. But we never can forget that sin itself is ultimately a rejection of God's plan for our lives. When we understand that God desires good for us, and follow His plan, we draw closer to Him. When we forget that, we separate ourselves from him.