"It was, however, a musician of Turkish origin who fully established the Islamic tradition of rationalistic philosophy. Abu Nasr al-Farabi (d. 950) went further than al-Kindi in seeing philosophy as higher than revealed religion, which became, in his view, a mere expedient and a natural social necessity. Where al-Farabi differed from both the Greek rationalists and from Christian philosophers, however, was in the importance he gave to politics. He seems to have believed that the triumph of Islam had at last made it possible to build the rational society that Plato and Aristotle had only been able to dream about. Islam was a more reasonable doctrine than its predecessors. It had no illogical doctrines, such as the Trinity, and stressed the importance of law. Al-Farabi believed that Shii Islam, with its cult of the imam as the guide of the community, could prepare ordinary Muslims to live in a society ruled by a philosopher-king on rational principles. Plato had argued that a well-ordered society needed doctrines which the masses believed to be divinely inspired. Muhammad had brought a law, backed by such divine sanctions as hell, which would persuade the ignorant in a way that more logical arguments could not. Religion was thus a branch of political science, and should be studied and observed by a good Faylasuf, even though he would see further to the kernel of the faith than the average Muslim." p. 72-73
So, really, rationalism and logic is the way to go about life, but because not everyone is advanced enough to understand that, they need to be placed inside of a religious system. The system will give them morals and laws and something to be afraid of so that they will behave and obey the blessed leader because God chose them. I find it an interesting point of view.