David had called Uriah back from the siege of a city, purportedly to get a report on how the battle was going. He then suggested that Uriah spend the night with his wife before returning to the battlefield. If Uriah had accepted David’s offer and slept with Bathsheba it would then appear that the child she had conceived during her night with the king was actually that of her husband. Thus, David’s sin could not be proven. Uriah balked at the suggestion that he should enjoy the pleasures of wife and bed while his fellows were engaged in life-threatening combat.
The Lord has dealt with me according to my righteousness,
according to the cleanness of my hands he has rewarded me.