1. Idleness and boredom can lead to trouble.
2. Lust can be particular. David had many women with whom he could have legitimately had sex. He wanted Bathsheba.
3. David's sin in 2 Samuel 11 mirrors Eve's sin in the garden. Both saw the fruit/woman, considered it/her delightful, took it/her, and then ate/had sex. In both cases, God confronts the sinner with their sin and the consequences. The difference in 2 Samuel is that David repents. Adam and Eve blame each other.
4. One sin leads to many more.
5. A friend who will unquestioningly help you cover you tracks is a bad friend to have.
6. We all have our weaknesses. David had two: the habit of using women for his own purposes (cf. Michal in 2 Sam 3) and the inability to bring about justice in his own home and among his friends. These two weaknesses caused major issues.
7. It is interesting that what God speaks to David about is not his sexual ethics but his mercilessness. In the previous 2 chapters, David has been commended for showing the love and compassion (hesed) of God. God was gracious to him, and he responded in graciousness to others. It is his un-hesed like behaviour towards Uriah that he is rebuked for in chapter 12. I am not wanting to trivialise sexual sin (it is not trivial), but it is not the act of having unwed sex that David is punished for. It is his mercilessness to Uriah (in taking his one wife and having him killed) and lack of gratitude to God for all his blessings.
8. From #7, I wonder if rather than getting all worked up over the sin of lust, we would do better to combat it by working to have the love and compassion of God influence all areas of our lives. Something like.... "You struggle with lust? Yeah, me too, but I'm not going to act on it because God has showed so much love to me and in response I'm going to show love to x,y, and z. Entertaining lustful thoughts won't help me do that."
9. If life is boring cause you've stayed home when you should have gone off to war (or work), you should busy yourself with thoughts of how you can be merciful to others. This is what David did in chapters 9 and 10 and it kept him out of trouble. (Kind of.)
10. God is gracious. From the beginning, David deserved nothing from God. God gave him so much and would have given him more if he had asked. After the Bathsheba/Uriah incident, David deserved nothing but judgement. (How many commandments did he break in chapter 11?) But God forgave him as soon as he began to repent! Bathsheba (who we have to assume is complicit in the whole sordid affair) was given another child - Solomon - who is particularly loved by God, incredibly gifted, and part of the family line of Jesus. What other God would do that?