Why didn't God punish David instead of taking the life of his child, which had done nothing to deserve death? One could argue that it was a great punishment to have the life of his child taken. If so, how was it fair for the baby to be punished for the sin of his father, David? Why not directly punish David?
2 Samuel 12:14
LS1910 - 14 Mais, parce que tu as fait blasphémer les ennemis de l'Eternel, en commettant cette action, le fils qui t'est né mourra.
For follow-up discussion and general commentary on the topic. Comments are sorted chronologically.
God said he would visit the sins (or punishments of those sins) onto the children up to the forth generation.
I want to expound on a point I tried to make in my answer; that we don't belong to ourselves. We have no right to life, good or bad. Life is a gift from God to us. I often hear, 'Then if life is a gift, why is it filled with trouble?” This is said as if a gift should be a perfect thing, when nothing on earth is perfect.
Then there's the notion that God put us here 'knowing that we'd sin and get in trouble with death (hell), so why did He put us here'? Never mind that we have children knowing that they'll face everything that we face. We still want children. It takes a world-class hypocrite to feel justified in doing what we acuse another of doing. We charge God with subjecting us with the potential of going to hell, and then we choose to have children who will potentially go to this place called hell.
So how do we settle this? Many decide that we weren't put here by a loving God. They decide that we ended up here some other way. All because there is a misunderstanding of God's awesome character and love.
God is love (1 John 4:8). Will we ever truly understand what this means?
God did not punish the baby. He saved the baby through death.
David said, He can not come to me, but I will go to him. David knew the baby was saved. David knew he was saved and would see his son in heaven.