All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His Slave and Messenger.
When the angels Haaroot (Harut) and Maaroot (Marut) taught people magic, it was a test and a trial for those people but the truth about magic was explained to them, and they were informed that it is the devil's work, and that it is forbidden and an act of unbelief. This was the wisdom behind sending Haaroot and Maaroot to those people in the first place. It was not a trial for the angels, nor was it an act of unbelief on their part. Shaykh ʻAbd Ar-Rahmaan As-Saʻdi commented on the verse saying,
“Allaah The Exalted says (what means): {It was not Sulaymaan (Solomon) who disbelieved, but the devils disbelieved, teaching people magic and that which was revealed to the two angels at Babylon, Haaroot and Maaroot.} [Quran 2:102] The verse underlines that the Prophet Sulaymaan did not commit unbelief as he did not learn magic, but rather the devils committed unbelief, teaching man magic by means of their misguidance and keenness to lead the sons of Aadam (Adam)astray, and it was the Jews who followed and pursued this magic which Allaah brought down with his angels Haaroot and Maaroot in the lands of Babylon in Iraq. Magic was brought down to them as a test and a trial from Allaah to His slaves.
Allaah The Exalted says (what means): {But the two angels do not teach anyone unless they say, "We are a trial, so do not disbelieve (by practicing magic)".} [Quran 2:102] That is, do not learn magic because it is unbelief. So they forbade magic and told people about its status. So the devils teaching of magic was for the sake of deception and misguidance, and to ascribe it to Sulaymaan, who Allaah declared innocent. And the angels' teaching of magic was to test people, and they also advised them so they would not have any excuses.
Those Jews followed magic taught by the devils and that taught by the two angels, forsaking the knowledge and guidance of the Prophets and Messengers of Allaah. Instead, they devotedly embarked on acquiring the knowledge of the devils. Verily, each inclines to that which suits him.”
We have explained in Fatwa 98889, to which we referred the questioner previously, that Allaah sent down the angels Haaroot and Maaroot as a trial for people.
As for the reports that those two angels are being held in a well somewhere in the land of Babylon (Babel) until the Day of Judgment, it is a false and fabricated story. Ibn Hazm said, "Babel is Kufa. It is known for its proximity and for being relatively small. There is no cave there with angels in it, and so this is confirmed to be a fabricated myth, since if it were true, that place would not be unobvious to the people of Kufa." [Al-Fisal fi Al-Milal wal-Ahwaa’ wal-Nihal]
Allaah Knows best.