29. Know that the philosophers, notwithstanding the multiplicity of their groups and the diversity of their doctrines, can be divided into three main divisions: Materialists, Naturalists, and Theists.
30. The first category, the Materialists, were a group of the most ancient philosophers who denied the existence of the omniscient and omnipotent Creator-Ruler. They alleged that the world has existed from eternity as it is, of itself and not by reason of a Maker. Animals have unceasingly come from seed, and seed from animals: thus it was, and thus it ever will be. These are the godless in the full sense of the term.
31. The second category, the Naturalists, were men who devoted much study to the world of nature and the marvels found in animals and plants; they also were much taken up with the dissection of animal organs. In these they saw such marvels of God Most High’s making and such wonders of His wisdom that they were compelled, with that in mind, to acknowledge the existence of a wise Creator cognizant of the aims and purposes of all things. Indeed, no one can study the science of anatomy and the marvelous uses of the organs without acquiring this compelling knowledge of the perfect governance of Him Who shaped the structure of animals, and especially that of man.
32. However, it appeared to these philosophers, because they had studied nature so much, that the equilibrium of the mixture of humors had a great effect on the resulting constitution of the animal’s powers. Hence they thought that man’s rational power was also dependent on the mixture of his humors and that its corruption would follow the corruption of the mixture of his humors, and so that power would cease to exist. Once it ceased to exist, they alleged that bringing back the nonexistent would be unintelligible. So they adopted the view that the soul dies, never to return. Consequently they denied the afterlife and rejected the Garden and the Fire, the assembly and the Recall, and the Resurrection and the Reckoning. So in their view there would be no future reward for obedience, and no punishment for disobedience. Therefore they lost all restraint and abandoned themselves to their passions like beasts. These were also godless men, because basic faith is belief in God and the Last Day — and these men denied the Last Day, even though they believed in God and His Attributes.
33. The third category, the Theists, were the later philosophers, such as Socrates, the master of Plato, and Plato, the master of Aristotle. It was Aristotle who systematized logic for the philosophers and refined the philosophical sciences, accurately formulating previously imprecise statements and bringing to maturity the crudities of their sciences. Taken altogether, these refuted the first two categories of the Materialists and the Naturalists. Indeed, by the arguments they advanced to lay bare the enormities of the latter, they relieved others of that task: “And God spared the believers from fighting (the unbelievers)” (33.25) by reason of the unbelievers’ own infighting.
34. Then Aristotle refuted Plato and Socrates and the Theists who had preceded him in such thorough fashion that he disassociated himself from them all. Yet he, too, retained remnants of their vicious unbelief and innovation which he was unsuccessful in avoiding. So they all must be taxed with unbelief, as must their partisans among the Muslim philosophers, such as Ibn Sina and al-Farabi and their likes. None, however, of the Muslim philosophers engaged so much in transmitting Aristotle’s lore as did the two men just mentioned. What others transmitted is not free from disorder and confusion and in studying it one’s mind becomes so muddled that he fails to understand it — and how can the incomprehensible be rejected or accepted?--Al-Ghazali Deliverance from Error.
In Deliverance from Error (recall and here), Al-Ghazali conceives the origin of philosophy as a atheist revolt against a natural form of theism, one that posits an omniscient and omnipotent Creator-Ruler of the sort that naturally accompanies sovereign kingship [in which the political ruler understands himself as a God, the mirror image of the cosmic Creator-Ruler). We are not told much else about the natural form of theism, but (given the stringent denials of the original philosophers), we can infer it posited a providential creation story. (I return to this below.) By contrast (on the hostile interpretation of Al-Ghazali) the first philosophers -- one can recognize a stylized picture of the atomists in it -- posit a cosmic order of eternal return without meaning.
Al-Ghazali is careful not to name any of these original philosophers nor to characterize the natural theism they reject. But they both precede Socrates. There is, in fact, a peculiarity here in that Al-Ghazali ignores the pure forms of Greek polytheism. The natural form of theism is closer to Judaism and (perhaps more likely on his mind) Zoroastrianism; and original philosophy a revolt against it.
Al-Ghazali's 'naturalists' are a kind of empirical, natural philosophers. (It's a bit surprising he does not mention medicine in this context, but there are hints of Galen throughout the piece.) These find evidence of functionality and design everywhere, there are led, inductively to a theistic designer. But they view a soul as something emergent from or grounded in physical processes and so mortal. Because they deny an afterlife (and resurrection), they become practical atheists.
It's no surprise that Al-Ghazali sees a tight connection between beliefs about the nature of the soul and, perhaps, more important the existence of judgment day and observed behavior. (Let's stipulate he is right about observed behavior.) But it is a bit surprising that the charge of immoral behavior is only lodged against the so-called naturalists and not the earlier materialists (a point repeated in paragraph 33!)
I called Al-Ghazali's narrative a 'genealogy.' But it would have been better, perhaps, to call it a 'natural history.' The achievement of the (Socratic) Theists is not just to refute the materialists and naturalists theoretically and to show why the behavior of the latter was truly immoral, but to turn an immature practice into a mature fields ("accurately formulating previously imprecise statements and bringing to maturity the crudities of their sciences.") To put Al-Ghazali's narrative in Kuhnian terms, Socrates is the start of a revolution in philosophy that culminates in Aristotle's achievements.
In the analysis of the after-effects of Aristotle's achievements, Al-Ghazali notices that even theistic philosophy inherit the "remnants of...vicious unbelief and innovation" of the naturalists and materialists relative to the original religion. This entails that Al-Ghazali treats the original religion as a species of (what we may call along with the tradition) true religion. Not for the first time (recall), I notice that Al-Ghazali suggests that that while Muhammad's revelation is instrumentally useful, it is not itself necessary for the existence of true religion.