The creation of Adam, the Command to the Angels to prostrate to Him, and the Rebellion of Iblis
Allah informs us of how He mentioned Adam to His angels before He created him, and how He honored him by commanding the angels to prostrate to him. He mentions how His enemy Iblis, amidst all the angels, refused to prostrate to him out of envy, disbelief, stubbornness, arrogance, and false pride. This is why Iblis said:
(I am better than him (Adam), You created me from Fire and him You created from clay.)(7:12) and
أَرَءَيْتَكَ هَـذَا الَّذِى كَرَّمْتَ عَلَىَّ
("Do you see this one whom You have honored above me...") 17:62
Ma'arif al-Qur'an
Mufti Muhammad ShafiOn ayahs 31–41
The Command to Prostrate was Given to Angels - Iblis was to Follow Suit
Addressing Iblis in Surah Al-A` raf, it was said: مَا مَنَعَكَ أَلَّا تَسْجُدَ إِذْ أَمَرْتُكَ (What stopped you from prostrating when I ordered you? - 7:12). This shows that the command to prostrate was given, along with the angels, to Iblis as well. However, the verses you have gone through a little earlier apparently give the sense that the command was particular to the an-gels. This could mean that the command was originally given to the angels but, as Iblis too was present among the angels, therefore, he too was covered by this command as a corollary - because, when the command went forth for the most august creation of Allah Ta’ ala, that is, the an-gels, that they pay their homage to Sayyidna 'Adam (علیہ السلام) ، it was obvious that any other creation was bound to follow suit under this command. It was for this reason that Iblis did not respond by saying that he was never asked to prostrate to begin with, so he could not be charged with the crime of non-compliance of the order. Perhaps, the words of the Qur’ an here: ' أَبَىٰ أَن يَكُونَ مَعَ السَّاجِدِينَ ' (He refused to be among those who prostrated - 30) may contain a hint in that direction. Rather than say: أَبَىٰ أَن یَّسجُدَ 1 that is, 'he refused to prostrate', what was actually said was: ' أَبَىٰ أَن يَكُونَ مَعَ السَّاجِدِينَ ' he refused to be among those who prostrated. This indicates that the main prostraters were after all the angels but Iblis too, being present with them, was reason-bound to join the prostrating an-gels. So, the Divine wrath was against his failure to join.
The existence of man is a combination of two things—one is body and the other is soul. The body is totally made up of materials of the earth. The analysis of the body shows that it consists of the same elements that are commonly known as water and earth. In other words, as far as the body is concerned, man is the name of a completely lifeless and unaware existence. But when God infuses a soul into it through His Will, this very body suddenly becomes the possessor of such capacities as are not found in any other creation in the known universe. The other creatures here on earth are known as ‘jinn’. The jinn, rivals of human beings, are made out of fire. They are fiery creatures, and just as the earth keeps itself away from the fiery sun, so that it should not burn out, similarly, man should keep himself away from the jinn, otherwise they will scorch him in the spheres of morality and religion.
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.