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:72:3

And ˹it teaches˺ that exalted is the nobleness of our Lord; He has not taken a wife or a son  

And ˹we believe˺ that (annahu: the pronoun in this and in the next two instances is that of the matter) — exalted be the majesty of our Lord, transcendent is His majesty and magnificence above what is ascribed to Him — He has taken neither spouse nor son.
القرآن:٧٢:٣

وَأَنَّهُ تَعَالَىٰ جَدُّ رَبِّنَا مَا اتَّخَذَ صَاحِبَةً وَلَا وَلَدًا  

{وأنه} الضمير للشأن فيه وفي الموضعين بعده {تعالى جد ربنا} تنزه جلاله وعظمته عما نُسب إليه {ما اتخذ صاحبة} زوجة {ولا ولدا}.