David said to Nathan, “I have sinned against the Lord.” And Nathan said to David, “The Lord also has put away your sin; you shall not die. Nevertheless, because by this deed you have utterly scorned the Lord, the child who is born to you shall die.” Then Nathan went to his house.
I've been trying to wrap my head around this part of scripture for a while now. How can a just God kill an innocent child for the sins of David? Most of the explanations I've been getting online have been incredibly unsatisfying, ranging from "It was an act of mercy for the child to die, he would have had a terrible life!" to "It's OK for God to punish innocents for the sins of the guilty." All of these feel inadequate.
To me, the one thing that sticks out to me is that Nathan says that God "[P]ut away David's sin", which seems to contradict the child's death being a punishment for sin. Is there an actual satisfying answer to this problem?