Technically, David was neither a murderer nor an adulterer, because the conditional divorces which were given to soldiers before going to battle were retroactive up to the time they left. Yes, what David did was beneath him which is why it is held against him in Scripture, but—admittedly by a technicality—he was neither of these things.
So why did God send Nathan to David with the story of the poor man, the rich man, and the sheep?
Why did God (via Nathan the prophet) tell David “Why did you despise the word of the LORD by doing what is evil in his eyes?”
Why did God punish David (”Out of your own household I am going to bring calamity on you.”) for these actions?
Why did David respond to all this by saying I have sinned against the LORD.?