David was under law and JESUS had not paid for our sins yet at that time so at that time the emphasis was on sin.The SPIRIT of GOD was not yet written on their hearts the way It was after JESUS paid for our sins ,the SPIRIT of GOD would come upon them but not stay so although salvation has always been by grace through faith they would be trying to be perfect In their spirits with their own strength and we know they would come short of the glory of GOD.I mean If after born again we murder people, we have to repent from murder, or stop murder. Like David murder uriah, than regret and not murder anymore though God still punish him and say David son Will die.
That mean God want David to obey the Lord, not kill for his wife.
1 John 2
3 And hereby we do know that we know him, if we keep his commandments.
4 He that saith, I know him, and keepeth not his commandments, is a liar, and the truth is not in him.
5 But whoso keepeth his word, in him verily is the love of God perfected: hereby know we that we are in him.
6 He that saith he abideth in him ought himself also so to walk, even as he walked.
In this verse also state : we know that we know Him if we keep His command.
It mean, we may think we know Him but is not.
The sign whether we know God or not is do we keep or obey His command?
Base oN These verses how people that keep murder and not repent save?
Until GOD makes a person’s spirit perfect they will not seek to purify themselves even as they are pure.