In Mormonism, David and Solomon's polygamy was justified before God. Their wives were gifts from God and that "in none of these things did he (David) sin against me save in the case of Uriah and his wife" (D&C 132:38). Mormons have a very loose sense of the word "sin".

"David also received many wives and concubines, and also Solomon and Moses my servants, as also many others of my servants, from the beginning of creation until this time; and in nothing did they sin save in those things which they received not of me" (D&C 132:38).

"I, the Lord, ... justified David and Solomon, my servants, as touching the principle of their having many wives and concubines" (D&C 132:1).