Wama Khalaqtul Jinna wal-Insa: Translation and Meaning
The verse means: And I did not create the jinn and mankind except that they should worship Me. In the two verses after it Allah says: I do not want any provision from them, nor do I want them to feed Me; indeed it is Allah who is the great Provider, the Possessor of strength, the Firm. In other words, the command to worship is not because of any need of Allah; He is free of all needs, and the benefit of worship goes to the servants themselves.
The mention of the jinn in the verse shows that they, like human beings, are bound by the Shariah. Imam al-Bukhari (may Allah have mercy on him), in the Book of Tafsir of his Sahih, wrote under this verse that Allah created the fortunate ones of both groups for His Tawhid, and he quoted some scholars as saying that Allah created them to act, then some acted and some abandoned it.
The True Meaning of Worship
Worship ('ibadah) is not only prayer, fasting and remembrance of Allah. The scholars of Ahl al-Sunnah have given it a comprehensive definition: every word and deed, outward or inward, that Allah loves and is pleased with is worship. It includes the obligations and the Sunnahs, and also truthfulness, trustworthiness, kindness to parents and earning a lawful living, provided the intention is Allah's pleasure and the method follows the Sunnah.
The foundation of worship is Tawhid, that is, every kind of worship must be for Allah alone. In Sahih al-Bukhari there is the hadith of Mu'adh (may Allah be pleased with him) that the Prophet ﷺ said: The right of Allah over His servants is that they worship Him alone and associate nothing with Him. This hadith is the best explanation of the meaning of this verse.
An Important Clarification
Some people ask: if everyone was created to worship, why do so many people not worship? The commentators answer that the verse describes the purpose that Allah loves and has commanded. Allah has given human beings free choice; whoever fulfils this purpose will succeed, and whoever turns away harms only himself; it does Allah no harm at all. The well-known saying about the purpose of creation, I was a hidden treasure, I wished to be known, so I created the creation, is quoted as a hadith, but according to the hadith scholars it is fabricated; the purpose of creation is what this verse states.
Key Lessons
This verse shows that all the occupations of this world, business and education are not the real goal but means; the real goal is servitude to Allah. Whoever keeps his work within the bounds of obedience to Allah and keeps his intention right, his whole life becomes worship. It is not right to abandon worship out of worry about provision, because in the next verse Allah Himself states that provision is His responsibility. This verse also negates every form of shirk (associating partners with Allah), because Allah alone deserves worship.