If Allah had willed, he would have sent only one divine religion; why did he allow the formation of different religions?
According to my knowledge, God has allowed to formate all different types of religion for a test. Because, He said in Quran:
”God has created life and death so that I can test you”
This what He said. And if God Said in Quran:
”Say, if your Lord willed, everybody would believe”
And also He said in Quran:
Which it means, if He wanted, He can destroy all the religions on Earth and replace them with Islam. Or, He can Make Earth to have a religion called Islam since the day Adam and Eve was created.
And also, God Said in Quran:
”If you want to believe, then believe. If you want to disbelieve, then disbelieve.”
Which it means, He granted us free will to chose wether we want to believe or disbelieve, no one can force us to believe or disbelieve.
That question you put forth has a simple answer, provided for you right in the Qur‘an: FREE WILL.
“If it had been your Lord‘s Will, they would have believed - all who are on Earth! Will you then (O Muhammad) COMPEL mankind to believe AGAINST THEIR WILL?” 10:99
“Let there be no compulsion in religion. Without doubt, guidance stands out clear from error.” 2:256
Allahu ta ‘Aala has a Sunnah, and He does not deviate from His Sunnah (33:62). It is the Sunnah of Allah to allow mankind the freedom to choose whether or not to believe in Him or disbelieve in Him, to obey or to disobey, to be loyal or disloyal, to remember and love Him or to be heedless of Him.
This freedom is the whole basis for accountability, judgment, as well as any rewards or punishments that we (meaning mankind) might receive on the Yawma Qiyamah.
Al-Islam teaches the ONLY way of living out our short lives on Earth that Allah is going to accept and approve of on the Yawma Qiyamah, (3:85). Those who choose another Deen (way of living) other than Al-Islam are going to regret that decision, (15:1-3).
I hope this answer is helpful to you.