2 Samuel 11:27
And when the mourning was past, David sent and fetched her to his house, and she became his wife, and bare him a son. But the thing that David had done displeased the LORD. And when the mourning was past, David sent and fetched her to his house, and she became his wife, and bare him a son. But the thing that David had done displeased the LORD.
The verse comes after David ordered Uriah to be set where the fighting was fiercest and then abandoned, so that the Ammonites would kill him, and Joab carried out the order and Uriah died. When Bathsheba's customary mourning was past, David sent and fetched her to his house and she became his wife and bore him a son. He had wronged and murdered Uriah, one of his most faithful soldiers, and hoped to enjoy the reward of his sin undisturbed.
David's idleness had left him open to temptation and led to his adultery with Bathsheba and his sin against Uriah culminating in murder. Useful, purposeful work would have kept and guarded him from that wrongdoing. His indulgence of appetite and passion led him to incur God's displeasure. One wrong step led to further wrongs until God rebuked him through Nathan.
The account exposes his abuse of the authority God had given him. When a king commands an act contrary to God's law, obeying him is sinful, a ruler's authority must be exercised in harmony with God's law, and human commands must not be obeyed when they conflict with it. The verse records that even a man entrusted with great responsibilities and favored by God could be overcome by temptation and commit grave wrongdoing.
Taking Bathsheba as his wife after Uriah's death did not make the earlier crime acceptable to God. The verse declares that the thing David had done was evil in the Lord's sight and displeased the Lord. His wrongdoing toward Bathsheba and Uriah was heinous, and God neither excused nor justified it.
David's standing as a man after God's own heart did not excuse his sin. That description applied when he was pure and followed God, and he lost it until repentance brought him back to the Lord. Past righteousness does not shield one who turns from righteousness and does evil. His sin against Bathsheba and his part in Uriah's death dishonored the Lord and misrepresented God's character. It lowered Israel's standard of godliness, weakened many people's abhorrence of sin, and emboldened those who did not love or fear God to transgress.
David had once kept God's Word before him as king and stood firm, but when he forsook its teachings he stained a once-excellent reputation. God rebuked David through Nathan the prophet. David's sincere repentance and confession brought forgiveness and acceptance, spared his life, and averted part of the threatened calamity.
Though forgiven, David still reaped the consequences of his wrongdoing and was punished for his sin and for giving the Lord's enemies occasion to blaspheme. The judgments on him and his household showed God's abhorrence of the sin. Violation of God's will by an individual brings a day of retribution. The account of his failure is preserved as a warning and lesson for later generations, not as an excuse for sin. It shows the need to obey God and that wrongdoing brings punishment. David's fall also encourages those who struggle and fail, because God's grace can give strength to rise and continue the conflict against sin.