2 Samuel 11:1 In the spring, at the time when kings go off to war, David sent Joab out with the king’s men and the whole Israelite army. They destroyed the Ammonites and besieged Rabbah. But David remained in Jerusalem.

2 One evening David got up from his bed and walked around on the roof of the palace. From the roof he saw a woman bathing. The woman was very beautiful, 3 and David sent someone to find out about her. The man said, “She is Bathsheba, the daughter of Eliam and the wife of Uriah the Hittite.” 4 Then David sent messengers to get her. She came to him, and he slept with her. (Now she was purifying herself from her monthly uncleanness.) Then she went back home. 5 The woman conceived and sent word to David, saying, “I am pregnant.”

6 So David sent this word to Joab: “Send me Uriah the Hittite.” And Joab sent him to David. 7 When Uriah came to him, David asked him how Joab was, how the soldiers were and how the war was going. 8 Then David said to Uriah, “Go down to your house and wash your feet.” So Uriah left the palace, and a gift from the king was sent after him. 9 But Uriah slept at the entrance to the palace with all his master’s servants and did not go down to his house.

10 David was told, “Uriah did not go home.” So he asked Uriah, “Haven’t you just come from a military campaign? Why didn’t you go home?”

11 Uriah said to David, “The ark and Israel and Judah are staying in tents,[a] and my commander Joab and my lord’s men are camped in the open country. How could I go to my house to eat and drink and make love to my wife? As surely as you live, I will not do such a thing!”

12 Then David said to him, “Stay here one more day, and tomorrow I will send you back.” So Uriah remained in Jerusalem that day and the next. 13 At David’s invitation, he ate and drank with him, and David made him drunk. But in the evening Uriah went out to sleep on his mat among his master’s servants; he did not go home.

14 In the morning David wrote a letter to Joab and sent it with Uriah. 15 In it he wrote, “Put Uriah out in front where the fighting is fiercest. Then withdraw from him so he will be struck down and die.”

16 So while Joab had the city under siege, he put Uriah at a place where he knew the strongest defenders were. 17 When the men of the city came out and fought against Joab, some of the men in David’s army fell; moreover, Uriah the Hittite died.

18 Joab sent David a full account of the battle. 19 He instructed the messenger: “When you have finished giving the king this account of the battle, 20 the king’s anger may flare up, and he may ask you, ‘Why did you get so close to the city to fight? Didn’t you know they would shoot arrows from the wall? 21 Who killed Abimelek son of Jerub-Besheth(b)? Didn’t a woman drop an upper millstone on him from the wall, so that he died in Thebez? Why did you get so close to the wall?’ If he asks you this, then say to him, ‘Moreover, your servant Uriah the Hittite is dead.’”

22 The messenger set out, and when he arrived he told David everything Joab had sent him to say. 23 The messenger said to David, “The men overpowered us and came out against us in the open, but we drove them back to the entrance of the city gate. 24 Then the archers shot arrows at your servants from the wall, and some of the king’s men died. Moreover, your servant Uriah the Hittite is dead.”

25 David told the messenger, “Say this to Joab: ‘Don’t let this upset you; the sword devours one as well as another. Press the attack against the city and destroy it.’ Say this to encourage Joab.”

26 When Uriah’s wife heard that her husband was dead, she mourned for him. 27 After the time of mourning was over, David had her brought to his house, and she became his wife and bore him a son. But the thing David had done displeased the Lord.

a. 2 Samuel 11:11 Or staying at Sukkoth
b. 2 Samuel 11:21 Also known as Jerub-Baal (that is, Gideon)

This is from Bible.org.

The author of our text informs us that it is spring, the time when kings go to war. Weather has always affected warfare. Battles have been won and lost due to the season. Winter time is not favorable to war. It is cold and wet, and camping out in the open field (as those who are besieging the city of Rabbah have to do -- see 11:11) hardly is feasible. The wheels of chariots get stuck in the mud, among other problems. And so kings usually sit it out for the winter, resuming their warfare in the spring. It is spring, Israel is still at war with the Ammonites, and it is time to finish the task of subduing them. The army assembles, under the command of Joab and his officers, and “all Israel.” They all go off to complete their victory over the Ammonites, who seem to retreat in their capital and fortress city of Rabbah.

Every man who is able to fight goes to war, except one -- David. David, we are told, “stayed in Jerusalem” (11:1).

The commentary at blueletterbible.org blames Bathsheba... saying she was on display!

He saw a woman bathing: There is little doubt that this woman (later called by the name Bathsheba) acted immodestly. Though it was evening and apparently the time when most people were asleep, certainly she knew that her bath was visible from the roof of the palace. Any immodesty on Bathsheba's part did not excuse David's sin, but she was still responsible for her wrong.

I'm not going to get into the inquiries and the plotting etc.... the fact is it happened and people knew about it. She wasn't pregnant when it happened.... that was documented... her husband was one of David's mighty men. Her husband trusted David with his life, literally.

I'd like to think that David took in the widows of his mighty men.... which would account for the large number of wives and concubines that the Bible attributes to him. This story, however, has me thinking that David's story may quack like a duck anyway. He was a womanizer. Beautiful women seem to be his downfall. Abigail was beautiful. David wasted no time taking her when her husband died. Now David is hooked up with Bathsheba. And unlike Nabal, who suffered a natural death, Uriah the Hittite was killed on the battle field. It was David himself who engineered that battle failure. David is now a murderer.