For those who might not remember the Bible study of your youth, in the story David happens to see Bathsheba bathing and then seduces her, knocking her up. Bathsheba is married to David’s military buddy (can’t remember the name), and so David tries to get his buddy to take a break from warring and make love to his wife so that everybody will think the baby is his buddy’s. His buddy doesn’t want to make love to his wife however, preferring the company of his men. So basically David arranges to have him killed, sending the very message to accomplish as much with the guy himself to be delivered to his superior officer. The superior officer sets him up to be killed by the enemy. God is angry of course and sends his prophet to yell at David. David feels bad and apologizes, but God punishes David by killing Bathsheba’s child.
Oh, and by the way, David didn’t resign. So neither will Mark Sanford. He’s sinned and now he’s sorry and it’s all better.