David had many wives
The command, Dt 17.17, the king shall not take for himself many wives.
The sins: David took for himself many wives.
2 Samuel 3:1–5 (ESV)
1There was a long war between the house of Saul and the house of David. And David grew stronger and stronger, while the house of Saul became weaker and weaker.
2And sons were born to David at Hebron: his firstborn was Amnon, of Ahinoam of Jezreel;
3and his second, Chileab, of Abigail the widow of Nabal of Carmel; and the third, Absalom the son of Maacah the daughter of Talmai king of Geshur;
4and the fourth, Adonijah the son of Haggith; and the fifth, Shephatiah the son of Abital;
5and the sixth, Ithream, of Eglah, David’s wife. These were born to David in Hebron.
2 Samuel 5:13 (ESV)
13And David took more concubines and wives from Jerusalem, after he came from Hebron, and more sons and daughters were born to David.