Iblīs was ordered to prostrate to Adam, and he understood that that the command included him, too, not just the angels.
The verse you quoted uses a form of exception in the Arabic language that is called severed exception, which means that what is being excepted does not share all the attributes of what is being excepted from:
وَإِذْ قُلْنَا لِلْمَلَائِكَةِ اسْجُدُوا لِآدَمَ فَسَجَدُوا إِلَّا إِبْلِيسَ أَبَىٰ وَاسْتَكْبَرَ وَكَانَ مِنَ الْكَافِرِينَ
And [mention] when We said to the angels, "Prostrate before Adam"; so they prostrated, except for Iblees. He refused and was arrogant and became of the disbelievers.
— Surat Al-Baqarah 2:34
In Adwā' al-Bayān (Arabic: أضواء البيان في إيضاح القرآن بالقرآن), Vol. 3, pp. 468-469, Mohammad ash-Shanqīti explains the difference between a continuous exception and a severed exception in the Arabic language (Arabic: الفرق بين الاستثناء المتصل والمنقطع):
- Continuous exception: the excepted and the excepted from share the same attributes, e.g., the congregation arrived except for Zaid (congregation is mostly people and Zaid is a person → continuous exception).
- Severed exception: the excepted and the excepted from do not share all attributes, e.g., the congregation arrived except for a donkey (congregation is mostly people and the missing donkey is not a person → severed exception).
Another example of a severed exception is:
يَا أَيُّهَا الَّذِينَ آمَنُوا لَا تَأْكُلُوا أَمْوَالَكُم بَيْنَكُم بِالْبَاطِلِ إِلَّا أَن تَكُونَ تِجَارَةً عَن تَرَاضٍ مِّنكُمْ ۚ وَلَا تَقْتُلُوا أَنفُسَكُمْ ۚ إِنَّ اللَّهَ كَانَ بِكُمْ رَحِيمًا
O ye who believe! Squander not your wealth among yourselves in vanity, except it be a trade by mutual consent and kill not one another. Lo! Allah is ever Merciful unto you.
— Surat An-Nisa' 4:29
A mutual trade is obviously not an unjust consumption of money that does not belong to one. This is a severed exception.
Furthermore, Allah demonstrates in another verse that Iblīs was indeed different: he disobeyed a command from Allah, which means he had the free will of obeying or disobeying, and he chose to disobey:
وَإِذْ قُلْنَا لِلْمَلَائِكَةِ اسْجُدُوا لِآدَمَ فَسَجَدُوا إِلَّا إِبْلِيسَ كَانَ مِنَ الْجِنِّ فَفَسَقَ عَنْ أَمْرِ رَبِّهِ أَفَتَتَّخِذُونَهُ وَذُرِّيَّتَهُ أَوْلِيَاءَ مِن دُونِي وَهُمْ لَكُمْ عَدُوٌّ بِئْسَ لِلظَّالِمِينَ بَدَلًا
And [mention] when We said to the angels, "Prostrate to Adam," and they prostrated, except for Iblees. He was of the jinn and departed from the command of his Lord. Then will you take him and his descendants as allies other than Me while they are enemies to you? Wretched it is for the wrongdoers as an exchange.
— Surat Al-Kahf 18:50
The free will is not limited to Iblīs, but to the entire population of Jinn who either believe or disbelieve:
قُلْ أُوحِيَ إِلَيَّ أَنَّهُ اسْتَمَعَ نَفَرٌ مِّنَ الْجِنِّ فَقَالُوا إِنَّا سَمِعْنَا قُرْآنًا عَجَبًا يَهْدِي إِلَى الرُّشْدِ فَآمَنَّا بِهِ ۖ وَلَن نُّشْرِكَ بِرَبِّنَا أَحَدًا
Say, [O Muhammad], "It has been revealed to me that a group of the jinn listened and said, 'Indeed, we have heard an amazing Qur'an. It guides to the right course, and we have believed in it. And we will never associate with our Lord anyone.
— Surat Al-Jinn 72:1-2
Finally, when Allah asked Iblīs about the reason he disobeyed, Iblīs did not at any one time claim that he was not commanded to do so; rather, he responded that he was better than Adam:
وَلَقَدْ خَلَقْنَاكُمْ ثُمَّ صَوَّرْنَاكُمْ ثُمَّ قُلْنَا لِلْمَلَائِكَةِ اسْجُدُوا لِآدَمَ فَسَجَدُوا إِلَّا إِبْلِيسَ لَمْ يَكُن مِّنَ السَّاجِدِينَ قَالَ مَا مَنَعَكَ أَلَّا تَسْجُدَ إِذْ أَمَرْتُكَ ۖ قَالَ أَنَا خَيْرٌ مِّنْهُ خَلَقْتَنِي مِن نَّارٍ وَخَلَقْتَهُ مِن طِينٍ
And We have certainly created you, [O Mankind], and given you [human] form. Then We said to the angels, "Prostrate to Adam"; so they prostrated, except for Iblees. He was not of those who prostrated. [ Allah ] said, "What prevented you from prostrating when I commanded you?" [Satan] said, "I am better than him. You created me from fire and created him from clay."
— Surat Al-A'raf 7:11-12
It is clear that Iblīs understood that Allah's command to prostrate included him, but he decided not to obey since he perceived himself to be of higher stance based on the fact that Adam was created from dust, whereas Iblīs was created from fire.