For the vast majority of human history, the only form of government was the few ruling over the many. As human societies became settled and stratified, tribal chiefs and conquering warlords rose to become kings, pharaohs and emperors, all ruling with absolute power and passing on their thrones to their children. To justify this obvious inequality and explain why they should reign over everyone else, most of these ancient rulers claimed that the gods had chosen them, and priesthoods and holy books obligingly came on the scene to promote and defend the theory of divine right.
It's true that religion has often served to unite people against tyranny, as well as to justify it. But in many cases, when a religious rebellion overcame a tyrant, it was only to install a different tyrant whose beliefs matched those of the revolutionaries. Christians were at first ruthlessly persecuted by the Roman Empire, but when they ascended to power, they in turn banned all the pagan religions that had previously persecuted them. Protestant reformers like John Calvin broke away from the decrees of the Pope, but Calvinists created their own theocratic city-states where their will would reign supreme.
Similarly, when King Henry VIII split England away from the Catholic church, it wasn't so he could create a utopia of religious liberty; it was so he could create a theocracy where his preferred beliefs, rather than the Vatican's, would be the law of the land. And in just the same way, when the Puritans fled England and migrated to the New World, it wasn't to uphold religious tolerance; it was to impose their beliefs, rather than the Church of England's.