In the name of Allah, the Most Gracious, the Most Merciful.
Quran: Chapter 18 ‘Qad Aflaha’ ‘Successful indeed are’, Sura: 24 ‘An Nur’ ‘The Light’, Verse: 3
Verse 3: The adulterer (fornicator, Zani) marries not but an adulteress (fornicatoress, Zaniyah or a Mushrikah); and the adulteress (fornicatoress Zaniyah or a Mushrikah) none marries her except an adulterer (fornicator or a Mushrik). Such a thing is forbidden to the believers (of Islamic Monotheism)
Explanation by samia2010oct: At the time of the Prophet Muhammad PBUH the society was so low in ethics that the adulterers and adulteresses did not used to hide from public. People used to know about the adulterers and adulteresses. These types of peoples were accepted in the society. Allah knows that believing people cannot live happily with adulterous people. So Allah tells in Quran that adulterer must marry the adulteress and vice versa. The adulterers and adulteresses must not marry believing men and believing women, Momins and Mominats.
It is Big Sin to marry a believing man with an adulteress or marry a believing woman with an adulterer. For Big Sins, Gunaah e Kabira, there is the punishment of unbearable burning of whole body by Unending Fire. At this point we also remember that there are many sins for which the punishment by Allah starts in this world too and this sin is one of them.
Explanation by Ibne Kathir: Allah tells: الزَّانِي لَا يَنكِحُ إلَّا زَانِيَةً أَوْ مُشْرِكَةً …
The Zani marries not but a Zaniyah or a Mushrikah; Here Allah tells us that the Zani (male who is guilty of illegal sex) does not have intercourse except with a Zaniyah (female who is guilty of illegal sex) or a Mushrikah (female idolator), meaning that no one would go along with him in this action except a sinful woman who is also guilty of Zina, or a Mushrikah who does not think it is unlawful. By the same token, … وَالزَّانِيَةُ لَا يَنكِحُهَا إِلَّا زَانٍ …and the Zaniyah, none marries her except a Zani, a sinful man who is guilty of fornication, … أَوْ مُشْرِكٌ … or a Mushrik (a man) who does not think it is unlawful. … وَحُرِّمَ ذَلِكَ عَلَى الْمُؤْمِنِينَ ﴿٣﴾ Such a thing is forbidden to the believers, meaning, indulging in this, or marrying prostitutes, or marrying chaste women to immoral men.
Qatadah and Muqatil bin Hayyan said: “Allah forbade the believers from marrying prostitutes.” This Ayah is like the Ayah (about marrying slave-girls):
مُحْصَنَـت غَيْرَ مُسَـفِحَـتٍ وَلاَ مُتَّخِذَاتِ أَخْدَانٍ
they should be chaste, not committing illegal sex, nor taking boyfriends. Sura ‘An-Nisa’ 4:25 And His saying:
مُحْصِنِينَ غَيْرَ مُسَافِحِينَ وَلاَ مُتَّخِذِى أَخْدَانٍ
desiring chastity not committing illegal sexual intercourse, nor taking them as girlfriends. Sura Al-Maidah 5:5
Imam Ahmad recorded that: Abdullah bin `Amr, may Allah be pleased with him, said that a man among the believers asked the Messenger of Allah for permission (to marry) a woman known as Umm Mahzul, who used to commit adultery, and who had stated the condition that she should spend on him. So he asked the Messenger of Allah for permission, or he mentioned the matter to him. The Messenger of Allah recited to him:
الزَّانِى لاَ يَنكِحُ إِلاَّ زَانِيَةً أَوْ مُشْرِكَةً وَالزَّانِيَةُ لاَ يَنكِحُهَآ إِلاَّ زَانٍ أَوْ مُشْرِكٌ وَحُرِّمَ ذلِكَ عَلَى الْمُؤْمِنِينَ
The Zani marries not but a Zaniyah or a Mushrikah; and the Zaniyah, none marries her except Zani or a Mushrik. Such a thing is forbidden to the believers.
Ibn Abi Hatim recorded that Abu Hurayrah said,
لَا يَنْكِحُ الزَّانِي الْمَجْلُودُ إِلَّا مِثْلَهُ
A Zani who has been flogged should not marry anyone except someone who is like him. A similar report was recorded by Abu Dawud in his Sunan.