ضَرَبَ اللَّهُ مَثَلً لِّلَّذِينَ كَفَرُوا
Allah sets forth an example for those who disbelieve,
meaning, the disbelievers who live together in this life with Muslims, their mixing and mingling with Muslims will not help the disbelievers, nor will it avail them with Allah, until and unless they gain faith in their hearts.
Then Allah mentioned the parable, saying,
اِمْرَأَةَ نُوحٍ وَاِمْرَأَةَ لُوطٍ
كَانَتَا تَحْتَ عَبْدَيْنِ مِنْ عِبَادِنَا صَالِحَيْنِ
the wife of Nuh and the wife of Lut. They were under two of our righteous servants,
means, they were the wives of two of Allah's Messengers and were their companions by day and night, eating with them and sleeping with them, as much as any marriage contains of interaction between spouses.
However,
فَخَانَتَاهُمَا
they both betrayed them.
meaning, in the faith, they did not adhere to the faith sent through their husbands nor accepted their message. Therefore, all the intimate knowledge of their husbands neither helped them nor prevented punishment, hence Allah's statement,
فَلَمْ يُغْنِيَا عَنْهُمَا مِنَ اللَّهِ شَيْيًا
So, they availed them not against Allah.
means, because their wives were disbelievers,
وَقِيلَ
and it was said,
meaning, to these wives,
ادْخُلَ النَّارَ مَعَ الدَّاخِلِينَ
Enter the Fire along with those who enter!
The part of the Ayah that reads,
فَخَانَتَاهُمَا
(but they both betrayed them) does not pertain to committing illegal sexual intercourse, but to refusing to accept the religion. Surely, the wives of the Prophets were immune from committing illegal sexual intercourse on account of the honor that Allah has granted His Prophets, as we explained in Surah An-Nur.
Al-`Awfi reported from Ibn Abbas,
"They betrayed them by not following their religion. The wife of Prophet Nuh used to expose his secrets, informing his oppressive people whenever any person embraced the faith with Nuh. As for the wife of Prophet Lut, she used to inform the people of the city (Sodom), who committed the awful sexual act (sodomy), whenever a guest was entertained by her husband."
Ad-Dahhak reported that Ibn Abbas said,
"No wife of a Prophet ever committed adultery and fornication. Rather, they betrayed them by refusing to follow their religion."
Similar was said by Ikrimah, Sa`id bin Jubayr, Ad-Dahhak and others