God (Allah) said in the Holy Quran :
=85 I only created jinn and man to worship Me. (Surat adh-Dhariyat: 56) "Why does Allah want us to worship Him?" Now if we are to look initially into revelation, to determine why was man created, there is a deeper question that we should be asking before that: "Why did God create?". This before we even get to man because man is not the greatest act of creation. Allah says: "The creation of the Heavens and the Earth is indeed greater then the creation of mankind; yet, most of mankind know not." [Surah Ghafir, verse 57] Man is not the greatest act of creation, this universe is far more complex and far more magnificent than man. So the issue of creation should then go to, "Why did God create?", as opposed to simply, "Why create man?". Human beings don=92t really create, they manipulate, because they can only "create" what already exists. When we make a chair or a table, we didn=92t create the wood, we had to take it from a tree, we didn=92t create the ****l, which makes the screws etc, we had to melt down rocks and take the ****l out. So we are not creating from nothing. We are manipulating things which Allah has already created in to different shapes and forms which are useful to us. We call it "creation" but the real act of creation, is creation from nothing, and this is unique to Allah alone.
There is another aspect, besides the fact that the creation exists because Allah is the creator. We can also see from what prophet Mohammad pbuh has informed us, that in the creation there is manifestation of Allah=92s attributes of mercy, forgiveness, kindness etc etc. Allah created man in paradise, they disobeyed Allah, but Allah had taught them how to repent, how to turn back to him and seek his forgiveness, then he would forgive them. Having done that, they were forgiven, Adam became the first prophet, and mankind was absolved of that sin. The story of Adam and Eve is the story of human existence. Human beings are given a consciousness of Allah. When Allah created all human beings, as he states in the Qur'an, he took from Adam (Adam) all of his descendents, and made them all bear witness that Allah is their Lord. So we are all born with that consciousness. He has also given us a consciousness of what is right and what is wrong.
we were created in a means or a way in which Allah has chosen to manifest his attributes of creation, mercy, grace etc and he could have chosen another one. But relative to us as human beings, we know that our purpose is to worship Allah. Allah does not need our worship, a Allah didn=92t need to create. When he created us to worship him, he didn=92t create us, out of a need for our worship, because Allah has no needs. In a famous hadith qudsi in which Allah says; If all of you, jinn and mankind, were to worship like the most righteous amongst you, it would not increase the dominion of Allah in any way shape or form. And if all of us, jinn and mankind ... Therefore when we look for the purpose of worship, we have to look into man. Allah created us to worship him, because we need to worship him. It is something he has given us as a means of benefiting ourselves. We are the ones who benefit from it. Worship has been established, fundamentally for the growth, the spiritual growth of man. This growth takes place through the remembrance of Allah. When you look at all the different aspects of worship, you will see the core of it is focused on the remembrance of Allah. "Establish the prayer for My remembrance." Allah has said that he has created us to test us, to see which of us is best in deeds. He is not testing us to know, in the sense that he doesn=92t already know, but this world is a test for us in order again that we can grow spiritually. We cannot develop this spiritual characteristic of generosity unless some of us have more then others and then we are required to give of the wealth we have. When we give, we grow. Similarly, if we were not in a position where others had more then us then we wouldn=92t have the ability to develop the higher spiritual quality of *******ment, patience, satisfaction in what Allah has given us. So it is all there in order to bring out the higher spiritual qualities, which enable us to attain the state, which makes us suitable and eligible to return to paradise. The paradise from which we were created, we were created in paradise and for paradise. Through our choices we have left, in this life, a field of testing, where we can grow to a state where we deserve paradise. The purpose of this life is the worship of Allah, this life is a test. A test for us, will we worship Allah, or will we forget Him. This is where our focus has to begin