Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:4:54

Or do they envy people for what Allah has given them of His bounty? But we had already given the family of Abraham the Scripture and wisdom and conferred upon them a great kingdom.  

Or, nay, are they jealous of people, namely, of the Prophet (s), for the bounty that God has bestowed upon them, in the way of prophethood and abundance of women? In other words, they wish that he be deprived of such things, saying, ‘If he were truly a prophet, he would not be concerned with women’. For We gave the House of Abraham, his forefather, the likes of Moses, David and Solomon, the Book and wisdom, and prophethood, and We gave them a mighty kingdom: David had ninety–nine women, and Solomon had a thousand, free women and slavegirls.
القرآن:٤:٥٤

أَمْ يَحْسُدُونَ النَّاسَ عَلَىٰ مَا آتَاهُمُ اللَّهُ مِنْ فَضْلِهِ ۖ فَقَدْ آتَيْنَا آلَ إِبْرَاهِيمَ الْكِتَابَ وَالْحِكْمَةَ وَآتَيْنَاهُمْ مُلْكًا عَظِيمًا  

{أم} بل {يحسدون الناس} أي النبي ﷺ {على ما آتاهم الله من فضله} من النبوة وكثرة النساء، أي يتمنون زواله عنه ويقولون لو كان نبيا لاشتغل عن النساء {فقد آتينا آل إبراهيم} جده كموسى وداود وسليمان {الكتاب والحكمة} والنبوة {وآتيناهم ملكا عظيما} فكان لداود تسع وتسعون امرأة ولسليمان ألف ما بين حُرَّةِ وسرية.