This passage has a companion text: 2nd Samuel 5:10 - 25.
David may have had as many as 20 women who called him their husband. In addition to his wives - Michal (the princess), Ahinoam, Abigail (formerly Nabal's wife); Maachah, (another princess), Haggith, Abital, Eglah (1st Chronicles 3:1- 5), Bathsheba (previously the wife of Uriah) and Abishag (the young virgin who only functioned as David's human electric blanket in his old age) - David had at least 10 concubines (2nd Samuel 15:16, 16:21-22 & 20:3).
Now, just because David did something, that doesn't make it right. In fact, just because he didn't get in any explicit trouble for it doesn't mean that it was ok. It is true that God told David that He would have been willing to grant to him more wives if he had asked but not Bathsheba (2nd Samuel 12:8). That brings up this matter of polygamy. It is obvious that God's original plan for matrimony was heterosexual monogamy (Genesis 2:24, Matthew 19:5 & Ephesians 5:31). And, Moses had specifically forbade exactly what Saul, David and Solomon all did (Deuteronomy 17:14, 15 & 17). But, David did it. And, we can see in the misbehavior of his children how his sin caught up with him.
David was still prosperous in his public life (1st Chronicles 14:17). However, his achievements in that arena shouldn't be interpreted by us as indicating that he had a license that precluded accountability in his private life. Make no mistake about it; David shouldn't have had more than one wife. But, our gracious God used him anyway.