This is what the Law required. Out of regard for his covenant with David, however, Jehovah wanted to see if there was a basis for forgiving David’s sin.
فَلَوْ سَمَحَ لَهُمْ بِٱلْحُكْمِ فِي هذِهِ ٱلْقَضِيَّةِ ،‏ لَمَا كَانَ لَدَيْهِمْ أَيُّ خِيَارٍ سِوَى إِصْدَارِ حُكْمِ ٱلْإِعْدَامِ ،‏ إِذْ إِنَّ هذَا مَا نَصَّتْ عَلَيْهِ ٱلشَّرِيعَةُ .‏