As to the hadith, it is worthwhile mentioning that there is no basis for the caliphate with an ideology for territorial expansion in either the Quran or in prophetic traditions.
Why did Mohammed claim he had been ordered to fight anyone, if Islam is not about world domination for its god Allah.
Sahih Al Bukhari Vol 004, Book 052, Hadith Number 196.
Narated By Abu Huraira : Allah 's Apostle said, " I have been ordered to fight with the people till they say, 'None has
the right to be worshipped but Allah,' and whoever says, 'None has the right to be worshipped but Allah,' his life and
property will be saved by me except for Islamic law, and his accounts will be with Allah, (either to punish him or to forgive him.)
Basic intellectual honesty dictates that when one is dealing with a piece of a text, is to put it in its context, rather than simply isolating it all on it’s own, and then deriving a supposed interpretation and conclusion. If it meant what those who know nothing, wanted it to mean, then these would have been able to find a precedent in the prophet of God's life to corroborate. But as already said and shown, such precedent is nothing but wishful thinking, and the divine source is explicit that There is no compulsion in religion, until the end of days, ironically the same day which, those who know nothing and believe in vain things, think that all races and nations will be forcefully bowing to their God Zech14.
As to the hadith, it is very close to a reoccuring Quran verse
8:39,2:193"And fight with them until there is no persecution, and religion should be only for Allah, but if they desist, then there should be no hostility except against the oppressors" the verse and its wider context are speaking of religious persecution. It is the right and duty of every Muslim to defend himself against that persecution causing him fear or preventing him completely from practicing his religion, or even compromising some of it to please the oppressor.
"and all the religion is for Allah" explains why religious persecution must be fought; by THE religion (singular, pointed with a definite article ie Islam) should be entirely for Allah, what is meant is there cannot be any forceful compromise between this way (Islam) and any other way or form of worship out of fear. Muslims should be able to worship freely and without any fear just as the followers of previous revelations had the right to worship safely and without any compulsion which is why it is said in 22:40 that throughout the ages Allah repelled some men by means of others to keep safe synagogues, churches and cloisters 2:251"And were it not for Allah's repelling some men with others, the earth would certainly be in a state of disorder; but Allah is Gracious to the creatures".
The end of the verse 2:193 re-stresses against whom fighting must be exclusively directed, showing that the aim is not to erase all other forms of worship, but only to stop fitna/religious persecution "but if they desist, then there should be no hostility except against the oppressors". (see 10:83,16:110,85:10 for fitna).
If they desist from persecution, the Muslims are at once to stop fighting against them, and hostilities are not to be continued against any except the aggressors. The interpretation that these words mean that fighting is to be continued until all people accept Islam, is therefore belied, not only by the clear wording of the verse itself, but by the rest of the Quran speaking of peaceful coexistance regardless of faith so long as no hostility is initiated against the Muslims, and also belied but by history itself.
There is no coercion in religion because truth is made plain through the revelation 2:256,18:29 it becomes self evident against falsehood and thus must naturally prevail over any form of worship that is not the surrender to Allah 3:19,9:33,34:46-47,48:28,61:9. This is according to a universal system established upon Truth, and where falsehood is therefore bound to vanish 15:85,17:81,21:16-8.
This prophecy which the prophet saw the fulfillement in his lifetime on the land of Arabia, is particularly made clear in 48:27-8 and does not signify that other religions would at any time entirely disappear. It only indicates that the superiority of the religion of Islam over all other religions will at last be established, and Islam will be the religion of the majority of the nations of the earth. Although it initially addresses a specific nation 6:92,42:7 since the one charged to deliver it was from that particular location, the Quran, because of its pristine nature in relation to the original monotheism and to all of humanity's innate disposition, as well as its universal, timeless relevancy, was meant as mercy to the entire world 62:3"and [to cause this message to spread] from them unto other people as soon as they come into contact with them".
It is the natural right of all Muslims and every human being to 26:227"defend themselves after they are oppressed". The divinely sanctionned right, throughout the ages and nations, of jihad in self defense has a clear objective which is not to gain territorial expansion but to dispel mischief, and corruption/fasad on the earth and stop religious oppression 2:251,22:40. Even though the object of the enemies of Islam when they take on arms and engage Muslims in war is to exterminate them entirely, the Muslims are told that the Divine object in assisting the believers in punishing the disbelievers at war is not to exterminate them, but to deliver a blow that would deter them from continuous agression 3:127.
Many verses, in addition to the ones previously mentionned, and passages lay out the limits of reprisal when one is exercizing his right to self-defence. That aspect of Jihad cannot be directed are those 60:8"who have not made war against you on account of (your) religion, and have not driven you forth from your homes..show them kindness and deal with them justly; surely Allah loves the doers of justice" or those who come in peace without any desire to fight 4:90 and this is because not all of Islam's opponents are alike, some do not strive actively for the extermination of Muslims and should therefore not be fought in the same way as one would engage an armed enemy. They, as well as others could be influenced by their comunity and so the benefit of the doubt is on their side 60:7"It may be that Allah will bring about friendship between you and those whom you hold to be your enemies among them; and Allah is Powerful; and Allah is Forgiving, Merciful".
Those upon whom the law of armed self-defense is ordained are 60:9"those who made war upon you on account of (your) religion, and drove you forth from your homes and backed up (others) in your expulsion". In situations of opression and the infliction of evil on them, the believers must retain their composure and live up to their level of faith and God-consciousness by keeping in mind the higher realities. Although they will be in no way blamable for retaliating and defending themselves with the same level of evil they have suffered, they should prefer magnanimity whenever pardoning can be conducing to reconcilement and possible reforming of the evil doer. And since in that case it necessarily involves the selfless act of supressing of one's own feelings for the sake of a higher truth, Allah reassures the person that the corresponding reward is well kept with Him and the Quran concludes once again by upholding and praising the virtues of patience and forgiveness in adversity, as well as recognizing the great resolve such an attitude requires 2:177,42:37-43.
What is to be kept in mind, once more is that in no case does Islam deny the basic human right of self-defense under opression. The Quran forbids any retaliation above and beyond what a person has himself received. The very foundations of the divine law, as taught by all Prophets, is the establishment of justice and to argue a person has no right to seek his rights is an absolute wrong. In the above verses, the Quran has taught the best attitude, and that is to forgive and continue calling people to right and goodness, even if the people try and persecute another but when the persecution becomes unbearable and life threatening, hindering one from religious freedom then retaliation within limits is permitted.
The Prophet's conflict with his tribe was not because of any worldly reason; it was only for the freedom to practice the religion of God 4:74,94 in the place originally dedicated for it.
He wanted the leaders of the Quraysh to fulfill their obligations towards the House of God because they were its custodians. If they were not ready for this, then they had no right to keep it in their custody nor did they have any right to stop people through persecution from embracing the religion of God or practicing their worship on a land settled for the universal worship of the One God since the days of Ibrahim 22:25-9. This was Allah's way before in regards to a land declared sacred but whose purpose was perverted and progressively abandonned by a people who despite knowing God, had perverted His ways Gen15:16,Deut9,1Sam4:7. They would intimidate any convert to Islam or anyone willing to embrace it. It was to eliminate this fitna that the Prophet was ordered to dislodge the Quraysh from Mecca. And when he did so as prophecied publicly as a matter of warning at the very beginning of his prophetic call, people hastened to accept Islam in multitudes now that they were suddenly afforded with the liberty to choose their own religion, in total freedom from the shackles of the Quraysh. 110:2 predicted this reality long before the conquest of Mecca "And you see men embrace the religion of God in multitudes", and this was through the
guidance of the Heavenly Book that transcended all obstacles to give life to the spiritually dead 6:122.