The Prophet ﷺ said, "Women are married for four things: their wealth, their lineage, their beauty, and their religion. So choose the one with religion, may your hands be filled with dust."
حدثنا مسدد حدثنا يحيى يعني ابن سعيد حدثني عبيد الله حدثني سعيد بن أبي سعيد عن أبيه
عن النبي ﷺ قال تنكح النساء لأربع لمالها ولحسبها ولجمالها ولدينها فاظفر بذات الدين تربت يداك
Bukhari narrated it in the Book of Marriage, in the chapter "The Suitability of Spouses in Religion," etc., Hadith 5090, from Musaddad, and Muslim narrated it in the Book of Suckling, in the chapter "The Recommendation of Marrying a Religious Woman," Hadith 1466, from the hadith of Yahya Qattan, through him.