The Prostration was before Adam but the Obedience was to Allah

Qatadah commented on Allah's statement,

﴿وَإِذْ قُلْنَا لِلْمَلَـئِكَةِ اسْجُدُواْ لاًّدَمَ﴾

(And (remember) when We said to the angels: "Prostrate yourselves before Adam.'')

"The obedience was for Allah and the prostration was before Adam. Allah honored Adam and commanded the angels to prostrate before him.'' Some people said that this prostration was just a prostration of greeting, peace and honor, hence Allah's statement,

﴿وَرَفَعَ أَبَوَيْهِ عَلَى الْعَرْشِ وَخَرُّواْ لَهُ سُجَّدَا وَقَالَ يأَبَتِ هَـذَا تَأْوِيلُ رُؤْيَـى مِن قَبْلُ قَدْ جَعَلَهَا رَبِّى حَقًّا﴾

(And he (Prophet Yusuf) raised his parents to the throne and they fell down before him prostrate. And he said: "O my father! This is the interpretation of my dream aforetime! My Lord has made it come true!'') (12:100)

The practice of prostrating was allowed for previous nations, but was repealed for ours. Mu`adh said to the Prophet , "I visited Ash-Sham and found that they used to prostate before their priests and scholars. You, O Messenger of Allah, are more deserving of prostration.'' The Prophet said,

«لَا لَوْ كُنْتُ آمِرًا بَشَرًا أنْ يَسْجُدَ لِبَشَرٍ لَأَمَرْتُ الْمَرْأةَ أنْ تَسْجُدَ لِزَوجِهَا مِنْ عِظَمِ حَقِّهِ عَلَيْهَا»

(No. If I was to command any human to prostrate before another human, I would command the wife to prostrate before her husband because of the enormity of his right on her.)

Ar-Razi agreed with this view. Also, Qatadah said about Allah's statement,

﴿فَسَجَدُواْ إِلاَّ إِبْلِيسَ أَبَى وَاسْتَكْبَرَ وَكَانَ مِنَ الْكَـفِرِينَ﴾

(And they prostrated except Iblis (Shaytan), he refused and was proud and was one of the disbelievers (disobedient to Allah).)

"Iblis, the enemy of Allah, envied Adam because Allah honored Adam. He said, `I was created from fire, and he was created from clay.' Therefore, the first error ever committed was arrogance, for the enemy of Allah was too arrogant to prostrate before Adam.'' I - Ibn Kathir - say, the following is recorded in the Sahih,

«لَا يَدْخُلُ الْجَنَّةَ مَنْ كَانَ فِي قَلْبِهِ مِثْقَالُ حَبَّةٍ مِنْ خَرْدَلٍ مِنْ كِبْر»

(No person who has the weight of a mustard seed of arrogance in his heart shall enter Paradise.)

Iblis had disbelief, arrogance, and rebellion, all of which caused him to be expelled from the holy presence of Allah, and His mercy.

﴿وَقُلْنَا يَاءَادَمُ اسْكُنْ أَنْتَ وَزَوْجُكَ الْجَنَّةَ وَكُلاَ مِنْهَا رَغَدًا حَيْثُ شِئْتُمَا وَلاَ تَقْرَبَا هَـذِهِ الشَّجَرَةَ فَتَكُونَا مِنَ الْظَّـلِمِينَ - فَأَزَلَّهُمَا الشَّيْطَـنُ عَنْهَا فَأَخْرَجَهُمَا مِمَّا كَانَا فِيهِ وَقُلْنَا اهْبِطُواْ بَعْضُكُمْ لِبَعْضٍ عَدُوٌّ وَلَكُمْ فِى الأَرْضِ مُسْتَقَرٌّ وَمَتَـعٌ إِلَى حِينٍ ﴾

(35. And We said: "O Adam! Dwell you and your wife in the Paradise and eat both of you freely with pleasure and delight, of things therein wherever you will, but come not near this tree or you both will be of the Zalimin (wrongdoers). '') (36. Then the Shaytan made them slip therefrom (the Paradise), and got them out from that in which they were. We said: "Get you down, all, with enmity between yourselves. On earth will be a dwelling place for you and an enjoyment for a time.'')