Here's the Jewish answer which I doubt anyone here will like. Since we are discussing what I consider a midrash (extra biblical story designed to teach us something, aka the adulterous woman story) I'll share with you a popular midrash about the instance you are referencing with King David.
As I explained in one of the other threads, in King David's time the soldiers always gave their wives a "gett" (certificate of divorce) before they went off to war.
This way if the husband was MIA the wives could remarry. If they did not have the gett then they could not remarry because they were still married and the hubby was just missing.
So in the case with Bathsheba (don't yell at me folks), it was not actually adultery;
she was divorced from Uriah because he was ... at war.
When the soldiers would return from war it was customary to remarry their wives.
That said, this is a letter of the law sort of thing and according to Jewish tradition everyone knew it; hence the stink.
OK here comes the part where you may want to stone me.
I'm not saying this is true just sharing it ... ***holding breath****
Uriah in Jewish tradition had tied the knot for Goliath's sword and when David wanted to remove the sword he supposedly said "hey I can't untie this crazy knot
if anyone can untie it he can have the best woman in Israel!" Uriah untied it (because he was the one who had tied it) David then gave him Bathsheba.
The problem is the Holy One Blessed be He had declared Bathsebah to be David's besheret. David is questioned by the prophet (not in the bible) who told you you could give whoever to Uriah now you will suffer because your match will be given to him instead.
Many days later ....
It is discovered that Uriah has disobeyed the King and he must die; David must execute him.
The Problem?
David is already involved with Bathsheba so instead of obeying what he is supposed to do by Torah he is embarrassed because people will surely say "oh He killed Uriah just because he wanted to steal his wife." So ... as the tale goes David had Uriah executed by the Amonite sword (you know the story). This was so he could obey the torah and execute the one deserving death (his sin supposedly was not doing it publicly).
Then that is why David did not have to die because while he supposedly had not broken the letter of the law, he had clearly violated the spirit of it.
Now again don't yell at me, I'm just sharing a midrash the best I can remember it, something may be off. I always thought this was utterly not true.
I still think it's *probably* untrue; but I will say there is a psalm that every time I read it I wonder, hmmmm...
Psalm 51 - my translation for clarity
1 לַמְנַצֵּ֗חַ מִזְמ֥וֹר לְדָוִֽד ׃
2 בְּֽבוֹא ־ אֵ֭לָיו נָתָ֣ן הַנָּבִ֑יא כַּֽאֲשֶׁר ־ בָּ֝֗א אֶל ־ בַּת־שָֽׁבַע ׃
3 חָנֵּ֣נִי אֱלֹהִ֣ים כְּחַסְדֶּ֑ךָ כְּרֹ֥ב רַ֝חֲמֶ֗יךָ מְחֵ֣ה פְשָׁעָֽי ׃
4 הַרְבֵּה כַּבְּסֵ֣נִי מֵעֲוֺנִ֑י וּֽמֵחַטָּאתִ֥י טַהֲרֵֽנִי ׃
הֶ֭רֶב
5 כִּֽי ־ פְ֭שָׁעַי אֲנִ֣י אֵדָ֑ע וְחַטָּאתִ֖י נֶגְדִּ֣י תָמִֽיד ׃
6 לְךָ֤ לְבַדְּךָ֨׀ חָטָאתִי֮ וְהָרַ֥ע בְּעֵינֶ֗יךָ עָ֫שִׂ֥יתִי לְ֭מַעַן תִּצְדַּ֥ק בְּדָבְרֶ֗ךָ
תִּזְכֶּ֥ה בְשָׁפְטֶֽךָ ׃
1. For the conductor, an instrumental song of David
2. When Nathan the prophet came to him, concerning his having come to Bathsheba.
3. Have compassion on me Oh G-d according to your loving kindness, as abundant is your mercy, blot out my transgressions.
4. Wash me completely from my iniquiteies, and from my sin purify me.
5. For my transgressions I indeed know and my sin is continually before me.
6. It is against You ALONE I have sinned, the bad (evil) I have done before your eyes, in order that You may be righteous in your words and pure in your judgements.
Every time I read that psalm, I pause a bit as I pass over the "Lekha l'vadkha chatati" "against You, You alone have I sinned"
If it was a true case of adultery would David have the audacity to say He only sinned against G-d and not against Uriah?
Now I know I know Nathan is pretty clear with his story he tells in David's hearing all I'm saying is that the psalm is interesting because it lends a small bit of credibility to the traditional account.
Hope you enjoyed,
shalom