Morally, David was worse than Saul. – T.D. Jakes
David was a murderer, adulterer, fornicator and liar. But, God judges the heart. While some people get excited about the prospect of sinning freely, sin has consequences.  David’s children endured chaos and curses. But, David’s heart and attitude of repentance, put him and his heir on the throne in place of Saul (1 and 2 Samuel).
What does that mean for us?  Our sin does not keep us from God once we accept Jesus as Savior.  But, sinning with no intent of submitting our lives to Christ, shows a lack of faith (Galatians 3:26, 27). Our faith should manifest our beliefs.  If we believe the Gospel, then our lives should reflect Christ.  And, God is so good, that when we obey Him, we also manifest a better quality of life.  And when we intentionally do not obey Him, the Lord disciplines those whom He loves for the sake of improving their lives.

Hebrews 12: 4You struggle against sin, but your struggles haven’t killed you. 5You have forgotten the encouraging words that God speaks to you as his children: “My child, pay attention when the Lord disciplines you. Don’t give up when he corrects you. 6The Lord disciplines everyone he loves. He severely disciplines everyone he accepts as his child.” 8If you aren’t disciplined like the other children, you aren’t part of the family. 10For a short time our fathers disciplined us as they thought best. Yet, God disciplines us for our own good so that we can become holy like him.