The creation of other creatures on earth is not meant to hold or entail material benefits for mankind; the material benefit is only one aspect of the story. The more important aspect is that contemplation and reflection over the creatures, irrespective of whether they exist or do not exist at present, can help mankind get closer to the God of the universe and can deter him from disobeying his Lord. And we know for sure that the power of thinking and intellection is a privilege that makes mankind superior to other creatures.
In addition, what is said about the earth is not in contradiction with scientific findings as God, the Almighty, may have had a special attention towards the planet earth while designing and creating the universe. Thus, it is likely that Allah created its initial nucleus before the stars and galaxies but made its final formation to take place after the creation of the skies. Such a concept also comes to the mind by looking at other verses of the Holy Quran.
Definitely, astronauts have not yet gone further beyond the moon planet and astronomers have not reached the end of the universe so that they may be qualified to give any precise and scientific view about the seven firmaments or skies.
Your question is divided into three parts:
1. Have all creatures, even animals like dinosaurs which have gone extinct, been created for man?
2. Does the Quran say that the earth has been created before the heavens (skies). Assuming that there is such a statement in the Quran, does it not contradict with what the contemporary science says?
3. Are there seven skies or firmaments above the earth?
We will deal with the foregoing questions in the same order:
In reply to the first question we must say that in order that the ambiguity be resolved, you do not need to take the trouble by giving examples of the past extinct animals. In fact, there are some animals, for the time being, that not only aren’t of any use in the first glance but they also cause him irreparable damages. For example, rats, cockroaches and the likes of such animals spread diseases and have no benefit for human beings.
Therefore, we must not assume that God’s sayings about the creation of the skies and the earth and what is in them for human beings means that all of them have some visible material functions or benefits for us. That is to say, we can use them for consumption as food or for residence, transportation etc. Such uses not only do not exist with the extinct animals but we cannot also see any benefits for human beings with most of the existing animals either. Nonetheless, if we consider them completely useless, we will get close to heretical and material thinking. The Quran says:
"و ما خلقنا السماء و الأرض و ما بینهما باطلا، ذلک ظن الذین کفروا فویل للذین کفروا من النار".
“And We did not create the heaven and the earth and what is between them in vain; that is the opinion of those who disbelieve then woe to those who disbelieve on account of the fire.”
In view of the above, we must find out the real meaning of such a verse, the meaning intended by God, the Exalted. Certainly, our infallible imams are the best interpreters in this regard.
In connection with the above and in line with what was just mentioned, there is a narration which nine infallible imams have narrated one after another. The chain of the narration reaches the Commander of the Faithful, Ali (a.s). In this narration, our Master, Imam Ali (a.s.) interprets the verses as such: The creation of the entire universe for human beings means that the man will learn a lesson from them and thereby he will achieve God’s satisfaction and (by drawing spiritual benefits from them) he keeps himself away from fire and divine punishment.
There is another verse which affirms this understanding in the sense that all what is in the heavens and in the earth have been introduced as signs which some human beings pass by and yet they do not learn any lesson from them.
The Holy Quran advises mankind to study the history of those who no longer live on earth simply because it wants us to learn lessons from their lives.
Therefore, we cannot consider the extinct animals as a reason to demonstrate the invalidity of the said verse because human beings can, by contemplating over these creatures, realize God’s power and get proximity to Him. This is enough for Allah to declare: “He it is Who created for you all that is in the earth.”
In addition, human beings have active and intelligent minds; they are the only creatures who keep other animals in places such as a zoon and a jungle park. They also collect the bones of dinosaurs and those of other extinct species and put them on display for mankind. Is there any creature other than man to carry out such activities?! Can’t we say that even those extinct animals have somehow been at man’s service to further draw his attention and help in promotion of his scientific activities?
On this basis, we believe, as the Quran says, God chose human beings from among all other creatures and placed everything which is on earth under his authority. However, those who believer in materialist schools use them only for their transient benefits, entertainments and at the most for scientific researches, and those who believe in God and in Hereafter not only make the above uses but they also consider them as signs and indications on behalf of their Lord that serve to strengthen and consolidate their beliefs. God, the Exalted, says: “On the earth are signs for those of assured Faith, as also in your own selves: Will ye not then see?”
2. When it comes to how the earth and the sky was created, there are different views and beliefs. However, the question is: Can what has been stated by the Quran be considered as opposed to the rampant theories in the present world? Obviously not, the Quran has not propounded or raised any subject that might have turned out to be wrong.
Moreover, we must know that the Quran is a book of guidance and it does not seek to provide details about everything in the universe. In fact, it makes reference only to generalities leaving further research and study in every area of sciences to human beings themselves. What is mentioned about the creation of heavens and the earth in the Quran does not mean that there existed no planets or galaxies before the creation of the earth; it does not mean also that God created the earth completely first and then He created the skies.
It is likely that your question may concern with the point that you may have deduced the posteriority of the creation of the heaven from the word “thumma” (then) in the verse whereas such an understanding is not correct because the word “thumma” does not always indicate posteriority of something in relation to something already mentioned. Sometimes, the case is the opposite.
Read this verse carefully:
"ألم تر إلی ربک کیف مدّ الظلّ و لو شاء لجعله ساکنا ثم جعلنا الشمس علیه دلیلا"
“Have you not considered (the work of) your Lord, how He extends the shade? And if He had pleased He would certainly have made it stationary; then We have made the sun an indication of it.”
If “thumma” was to necessarily indicate posteriority, then we should believe according to this verse that the shade should have been there first of all and then the sun should have come into existence whereas there is no doubt that shade does not exist unless the sun is there.
Therefore, the word “thumma” in the said verse of the Holy Quran never signifies temporal posteriority and we cannot conclude either that the earth is older than the skies so that it might be inconsistent with today’s science.
Secondly, there is another verse in the Quran which explicitly states that the creation and expansion of the earth in its present form and shape had taken place after the creation of the sky. Of course, some consider that verse to be in contradiction with verses which apparently denote that the earth was created before the skies. However, the apparent contradiction is resolved, if you study carefully those verses and contemplate over them.
In view of the two foregoing explanations, we cannot say for sure that the Quran considers the skies to be younger than the earth. Nevertheless, even if we assume that the word “thumma” implies temporal posteriority, is there any objection to say that God first created the earth’s initial nucleus before the stars and galaxies but the final formation of the earth took place after the creation of the skies? Does such a process contradict with the accepted theory which says that matter and energy never got destroyed and terminated; but they changed into one another?
3. As for the last part of your question, we must say: Although astronomers have discovered many galaxies and constellations with billions of light year distance, they have not been able to reach the end of the world and to become aware of the layers of the sky or what is known as firmaments.
As well, the astronomers have been able to travel to the moon which is just a little more than one light second distance from the earth. Millions of light years distance have been discovered and billions more remain undiscovered? Therefore, the scientists are not basically qualified to comment on such issues and they also do not claim that they are qualified to comment on such matters.
However, the exegetes and interpreters of the Holy Quran have given various views in this regard. For instance, it has been said:
“If we define number seven as a number meaning “multiplicity”, then it means that there are numerous worlds, planets, constellations and galaxies above you. And if we define number seven in its literal sense (the number seven), then it means that there are six worlds other than the world which we are in. They are a collection of stationeries, planets and galaxies which human beings do not access to and that science has not yet reached.
 - Saad, 27.
 - Shaykh Saduq, Uyoon Akhbar al-Reza (a.s.), vol.2, hadith 12, pg. 29, Jahan Publications, Tehran, 1378 A.H.
 - Yusuf, 105. “And how many Signs in the heavens and the earth do they pass by? Yet they turn (their faces) away from them!”
 - Yusuf, 109; Hajj, 46; Room, 9; Fater, 44; Ghafer, 21 and 82; Muhammad, 10; etc.
 - Question 751 deals with ‘Man’s being superior to other creatures’, you can refer to read it.
 - Adh – Dhariyat, 20 – 21.
 - Furqan, 45.
 - Al-Naze’aat, 27 – 30.
 - For further information in this regard, regard question 3634.
 - Makarem Shirazi, Naser, Tafsir Namunah, vol.14, pg. 216, Dar al-Kutub al-Islamiyah, Tehran, 1374 (1995).