I once gave a lecture entitled "Ways to Avoid the Scourge of Sin" wherein I quoted these verses.
In that speech of mine, I stated that the disagreement mentioned in these verses is the disagreement between believers and unbelievers, separating those who will go to Paradise from those who will go to Hell. I then mentioned the following verse in support of what I said:
"We had sent to the people of Thamûd their brother Sâlih saying: 'Worship Allah', but they became two factions bickering with one another." [Sûrah al-Naml: 45]
Later on, a brother approached me saying that he had always been confused about the meaning of those verses in Sûrah Hûd. He had studied some commentaries of the Qur'ân and read that Allah created people preordained to disagree in this way. Then he came across other commentators who condemned and refuted such an interpretation in the harshest of terms. He asked me to clarify the issue for him.
The meaning of Allah's words "If your Lord had so willed he could have made humanity one people, but they will not cease to disagree" can be understood as follows:
If Allah had willed, he could have created humanity as one community united by a single frame of mind. This is how He created the angels. They all obey Allah with single-minded and unquestioning devotion. However, He decided to endow humanity with free will and make them a creation that could be tried and that would be tested. He wanted to give them the chance to accept either guidance or error. He wanted to give them the choice between good and evil. They needed to have the ability not only to work righteousness, but to be able to engage in corruption as well.
Allah describes this special creation of His - the human being - in the following way:
"Had there not come upon the human being a period of time when he was a thing not worthy of mention? Verily, we created the human being from a drop of mingled sperm in order to try him, so We gave him the gifts of hearing and sight." [Sûrah al-Insân: 2]
"Verily We have created the human being into toil and struggle. Does he think that none has power over him? He may say: 'Wealth have I squandered in abundance.' Does he think that none can see him? Have We not made for him a pair of eyes? And a tongue and a pair of lips? And shown him the two ways?" [Sûrah al-Balad: 10]
"We showed him the way: whether to be grateful or ungrateful." [Sûrah al-Insân: 3]
When Allah says "but they will not cease to disagree", he is speaking about something that He, with His all-encompassing knowledge, knows is going to take place in the world. Allah created humanity with a unique set of attributes. These attributes allow people to disagree. He gave them the free will to choose between faith and unbelief and between righteousness and sin. Therefore, in the world there will be people who will choose to believe and others who will choose to reject faith. This is why Allah says: "And for this He did create them." This is how these verses should be understood.
However, it is possible that Allah is not only referring to the fundamental disagreement between believers and unbelievers. He may also be alluding to the differences that exist within the ranks of the believers themselves. Some believers are pious and devout, avoiding sin to the utmost extent humanly possible. Others are weak and easily fall victim to their base desires. In this context, Allah's words: "Except those on whom your Lord has bestowed his mercy" refer to those Muslims who abstain from sin and only disagree with each other in matters wherein Islamic Law permits disagreement.
And Allah knows best.