So He said to the angels...
So He said to the angels: Select two beings from your community so that I may send them to the earth and give them the nature of human beings and put in them desire for eating, drinking, etc. and introduce yearnings in their minds like the children of Adam. Then I will take a test of them in the matter of My obedience and worship. The angels selected Harut and Marut from among them as they were foremost in finding faults in humans and in asking for Allah’s chastisement for the humans.
Allah told them: Now I have put all those desires and needs in you which I have created in men. Do not include anyone (do not make any partner) in worshipping Me, do not commit adultery and do not drink wine. Then He removed all curtains of the skies so that He may make His power visible to the angels. He sent those two angels on earth in the form of two handsome men and made them camp in Babylon. When they came to earth, they saw a very beautiful woman advancing towards them.
She was fully adorned and perfumed and her face was unveiled. Now the two angels had a thought about the woman that they were prohibited from. They discussed it between themselves and decided to walk away from the temptation. After walking a few steps, passion overpowered them. They returned to that woman and asked her to allow them to have sex with her. That woman said, My religion does not allow me to lie with you until you adopt my religion. They inquired her religion.
She said, I can only fulfill the desire of the one who worships my Allah and who prostrates before my Allah and she pointed towards an idol saying, this is my Allah. The angels looked at one another and exclaimed: Now two sins (instead of one) confront us viz., one of Polytheism and another adultery. Then they consulted again but desire overtook them. So they said to the woman: We are agreeable.
Then she said, As you are prepared to bow before the idol you must first drink wine because prostration without taking wine is not recognized. The angels consulted again and said, Now three sins confront us-drinking wine, having illegal sex and prostrating before an idol. They said to that woman: Verily you have proved a big trouble for us. Still we are ready to do whatever you say.
So they drank the wine and bowed before the idol and they readied to lie with that woman when suddenly a beggar entered the place. They asked him: Who are you and why have you come here? He replied, “Your condition makes me doubt your intention.