It is a theme in the bible, beginning with Cain. God owns us all and as God can do with us what He will. David trusted God to give him back the son in Heaven, for as David said, "I will go to him."
Nonsense! The Jews did/do not have a concept of Christian heaven and hell. They only know a "depository of the souls," Shoel, or the Hades in Greek. David knew that he would die one day and 'go' to his son.
The real message is that David repented and humbled himself; that is the recurring theme in the Bible. God forgives those who repent. The rest is fluff for local cultural and ethnic consumption. As Nikitas Stithos (a hesychast) says, the incorruptible and imperishable are "tears of repentance, acts of charity, compassion, prayer, humility, faith, love." Those are things of God we learn through Christ.