As an Islamic Philosopher, I find it difficult why people presume Imam Al-Ghazali (rh), caused a decline in Islamic scientific, and philosophical productivity.
It is clear in his "Tahafut al Falasifa" his intentions are simply undermining the outcomes of Aristotellian-Platonic Philosophy, and not necessarily philosophy or logic itself. If this were not the case, Ghazali would be maintaining a contradiction, if Ghazali were to use philosophy to debunk ALL of philosophy.
As for scientific enquiry, in his "Deliverance from Error", Ghazali has an introductory chapter on mathematical sciences. He even says this outstanding statement:
Great indeed is the crime against religion, committed by anyone who supposes that Islam is to be championed by the denial of these mathematical sciences.
Further, I dont see how Ghazali's Occaaionalism plays any role in this at all. Sure, it helps maintain a God-centered worldview, but how does that effect productivity? It's not like the scholars are gonna pack up their stuff and leave, "Hey boys, Ghazali won, time to stop thinking".
So why do large amounts of people, still believe he is the cause for the "lack" of scientific/mathematical/philosophical enquiry in the Muslim world?
I'm not a historian or a philosopher, but a scientist who happens to be Muslim. So I don't claim to be an expert on this. But the decline of Science in Islamic civilization has really interested me, so it's something I casually read up on.
I'll start off with answering your question first, then argue my point, from what I've read on the subject. No, Al Ghazali didn't single handily responsible for the Islamic Dark ages. No single ruler or event was responsible for this. At the same time, it'd be unfair to totally dismiss his contribution to what eventually happened. Whatever his intention was.
During Al-Ghazali's time, the Muhtazilla group (proponents of absolute free will universe) were a persecuted minority. I'm aware that Muhtazilla's also persecuted the ocassionalist (Ashari) school of thought, often brutally. Which didn't help with how they were treated when they were overthrown. Non the less, pockets of Muhtazilla thinkers still existed throughout the Caliphates.
Al Ghazali was a proponent of intellect, and a denouncer of violence, his followers however single out and condemned great thinkers like Al Farabi, Al Biruni, Al Rawabi, Ibn Sina and Ibn Rushd. Their studies and properties were confiscated, and their teachings were deemed heresy, their achievements were twisted, and their books were burned. Not exactly the kind of environment that fosters intellectual progress...
Even though Al Ghazali liked to portray himself as a promoter of reason and intellect. He classified science into three categories:
Religious studies: Jurisprudence, theology, Arabic grammar, etc
Traditional faculties of science: Astronomy, Alchemy (proto-chemistry), medicine, mathematics etc
Spiritual and cultural studies
The 3rd category of "science" (as he deemed it) was rejected, leaving only 1 and 2. The traditional scientific and mathematical entities were deemed nothing more than a useful tool, as long as it was used for religious purposes. In reality, it (to my understanding) ment using science/technology as a mere tool to stay on power. Not for higher means. Not the same level that inspired later Christian scholars like Newton and Gallileo, or earlier Islamic scholars during the Muhtazilla era. What I'm trying to say is, individuals can be inspired by religion to study science and nature. But science pressed into the service of religion has a very dishonorable history. It's used for justifying all kinds of pseudoscience.
Many academics regard Al Ghazali to be the second most influential figure of Islam after the final prophet. The political elites and the common folk endorsed al Ghazali as the kind of person that appears at desperate times (the 1st crusades was around his time) to rejuvenate Islam. Therefore, the scholar impregnated Ashari's belief in mainstream culture.
Although Al Ghazali endorsed intellect and denounced violence, it can also be argued he used them only as an instrument to undermine his opponents. Al Ghazali was never anti-science. But it can be argued the status of the sciences were significantly attenuated from his influence. Which, in my opinion, sealed the fate of Muslim's attitude to Science. It's used in the service of religion. Which really means, used in the service of the people in power. And, judging by how catastrophically Muslims tend to lose wars in recent times. NOT USED VERY WELL. You can't substitute freedom in intellectual pursuits. When you let others define the parameters of science and intellectualism, you're castrating man's ability to think. At least that's my opinion. Many Muslims and Non-Muslims don't know this, mathematics was once considered as spiritual and holy of pursuit as prayer. That kind of attitude was once the mainstream in the Islamic world.
In summary. No Al Ghazali wasn't anti-science. But his influence did play a significant part in severely limiting academic freedom. It influenced what could and couldn't be taught at Madrassas/Universities, and severely degraded the status of science/mathematics in the Islamic culture. Either to be used as a tool to support religion. I've heard plenty of Muslims talk about the philosophical aspects of quantum physics, and how it supports Hadith, let alone Quran. Yet press them on the mathematical underpinnings, which Physics is built on, and they'll feel very uncomfortable. The same people will completely invalidate you for not being able to speak Arabic. There's a cosmos of difference between a layman understanding of Quantum Entanglement, something I've seen Muslim use to somehow connect to miracles, and the mathematical arguments underpinning it. Scientists got there through maths, not philosophical thoughts. They endorse/criticize things they have a surface level understanding of. Yet the same people criticize others for not knowing the subtleties of the Arabic language. As a Muslim, I see that as nothing more than tragedy and a 1000 year farse.
"Ideas have wings, and no one can stop its flight"
Ibn Rushd
Eric Chaney has argued that the key change is not philosophical in origins, but political. He has charted the influence of Islamic scientists on contemporary science using modern citations, and replicates much of the standard narrative - there is a large peak in Islamic science during the early golden age, and a substantial dropoff from the 11th century onwards. His preferred explanation for this is a shift in the political economy of Islamic countries. During the rise of the Seljuks and the associated Sunni revival, secular bureaucracies were increasingly replaced by military governments employing slave soldiers, who legitimated their essentially military rule though appeal to religion.
To this end, military rulers empowered religious authorities, defended and enforced their rulings, and linked their legitimacy to orthodox interpretations of Islam. For their part, religious authorities mediated the relationship between the state and society, softening what would otherwise be quite a harsh, unrepresentative form of government. This alliance involved suppressing dissenting views on religion, as these would not only be philosophically but also politically destabilising. Existing knowledge was largely harmless, and could be safely promoted, but radical new ideas about the shape of the cosmos or the nature of reality could undermine existing religious interpretations, upon which the whole political edifice was built.
The contemporary rise and profusion of madrassas thus served as the basis for both religion and for knowledge promoted the dissemination of knowledge, but it also left education and scholarship almost exclusively in the hands of religious authorities. Collectively, they favoured orthodox over heterodox (including rationalist) views of Islam, as the latter could undermine both their own and their political patrons' authority. It's not that thinking stopped, but rather thought was channelled away from "rocking the boat," so to speak. Not all philosophy was to be condemned, but rather new and different philosophy was to be viewed with the suspicion that it would lead you away from god, or rather away from orthodox views of god.
In this narrative, then, Al-Ghazali is not the cause of the decline of Islamic science and philosophy, as though one person could so such a thing through sheer force of argument. Rather, he is but rather one very prominent example of a new school of thought on the proper role of religion in Islamic polities, with its basis in political changes.
So goes Chaney's synthesis of the story, in any case. Links to most of Chaney's papers, including the bases for this post, can be found here: https://sites.google.com/site/ericjustinchaney/publications