Why did God kill David and Bathsheba's first son?


Because David gave God's enemies a reason to blaspheme

Because by this deed thou hast given great occasion to the enemies of the LORD to blaspheme, the child also that is born unto thee shall surely die. 2 Samuel 12:14