God creates laws for His children not because he wants to restrict us, but because he desires a relationship with us so that we may be able to draw nearer to Him. He also gives us laws to protect us from the harmful repercussions of sin. Therefore, if David had followed God’s laws, he would not have been faced with such turmoil towards the end of his kingship.
Before becoming a king, David is solely dependent on God. However, after realizing that kingship comes with many powers, David starts to rely on his will to overpower his judgment and knowledge of God and His will. Although it may seem like David’s sin begins at the moment he lays his eyes on the beautiful Bathsheba bathing on the rooftop, his sins actually begin many nights before when he makes decisions that turn his focus from the will of God to the will of self. Thus, David’s first sin of focusing on his own will, rather than God’s, leads to one sin after another which eventually causes a curse to fall upon David’s household.
When David commits the sin of adultery with Bathseba and gets her pregnant, and then murders her husband Uriah, he does not realize that what he has done is wrong. Therefore, God sends Nathan to David, who uses the parable of the rich man who steals the poor man’s sheep to let David know of his own sin. David responds to the parable by condemning himself without even realizing that he was doing so. After realizing that he had sinned greatly against God, David humbly confesses to God that he has sinned. Although God forgives David, he punishes him by killing the first child that