I want to understand the widsom behind the divine command to the angels to prostrate themselves before Adam. We hear that Iblees was not one of them. Can you please help me?
While commenting the relevent verses of Surah al-Baqarah Mr Ghamidi writes about the issue:
Bowing down before Adam (sws) was meant to pay respect to him and was done at the bidding of the Almighty. Consequently, there is no element of polytheism in it. It was for two reasons that the Almighty had tested the obedience of the angels in such a manner: firstly, real success does not depend upon the substance of one's creation; whether someone is created from light or from fire, the real thing is obedience to the Almighty; hence Adam (sws) too at all instances must overcome his false pride to submit to the truth. Secondly, Adam (sws) must realize that when the Almighty elevated him to such a position that the angels bowed down before him, then it is not all befitting for him to worship a creation however much superior to him by granting it divine status with the Almighty. It is only befitting to serve and worship Allah. If he associates someone with Him, he not only shows disrespect to the Almighty but to himself as well. (http://www.al-mawrid.org/pages/articles_english_detail.php?rid=1185&cid=94)
As for the question why Iblis who was a jinn had to bow while the directive was addressed to the angels we believe there could be two reasons:
1. The Almighty actually commanded all present to prostrate when this really happened. However, while narrating the incident in the Holy Qur'an He only mentioned the dominant party of those present. Thus Iblis was omitted in the quotation of the command. However, the Qur'an itself makes clear that he was also required to prostrate elsewhere.
2. The Almighty commanded those who were present to prostrate before Adam but only mentioned the dominant group. When a senior and dominat group is asked to something the lesser and the dominated part is included by default. For example if leaders of a party are asked to do something the command covers the commoners among them too unless explicitly omitted.