Sometimes people say things in the state of intoxication which should not be given relevance by others. Imam Ghazali took a lenient view of such expressions of some of the Sufis, who uttered things like, "I am the Creative Truth", "Within this Robe is naught but God" etc. He never condemned them, and the most he said regarding them was this,
Regards.
You didnt provide a reference for the quote, but anyhow, that statement about not speaking of the beliefs, is pretty widespread in Sufi and Baatini cultures (Sufism, Shiasm, Alawi, Isma'eeli etc) in general. This is why sometimes discussing things with them, it becomes hard because sadly, they arent clear to others about their beliefs.
Anyhow, back to Al Ghazzali, it is important to know that he went through many stages in his life. The following explains this. (I didnt write it)
Adh-Dhahabi narrated in his book, that Muhammad ibn al-Waleed al-Tartooshi said, "…he became a Sufi and forsook knowledge and its people, then he got involved with 'inspiration' - those who claim to have spiritual knowledge and the insinuating whispers of the Shaytan. Then he mixed that with the views of the philosophers and the symbolic phrases of al-Hallaaj. He started to criticize the fuqaha (jurists) and the scholars of Ilmul-Kalaam. He almost went astray from the religion altogether when he wrote al-Ihya [i.e., Ihya Uloom al-Deen]. He started to speak of the inspiration and symbolic words of the Sufis although he was not qualified to do that and had no deep knowledge of such atters. Hence he failed and filled his book with fabricated reports, "I (ad-Dhahabi) say, "as for al-Ihya, it contains many false ahadeeth and it contains much that is good. I wish that it did not contain etiquette, rituals and asceticism that are in accordance with the ways of the philosophers and deviant Sufis. We ask Allah for beneficial knowledge.
Do you know what beneficial knowledge is? It is that which Allah revealed in the Qur'aan, which was explained by the Messenger in word and deed, and the type of knowledge which we are not forbidden to acquire. The Prophet said, "Whoever turns away from my Sunnah does not belong to me." So, my brother, you must ponder over the Words of Allah and persist in studying al-Saheehayn (Saheeh al-Bukharee and Saheeh Muslim), Sunan al-Nasa'ee, Riyadh an-Nawawi and al-Adhkaar by an-Nawawi, and then you will succeed and prosper. Beware of the opinions of the philosophers, the practice of spiritual exercises, the starvation of monks, and the nonsense talk of those who stay alone for long periods in their monasteries. All goodness is to be found in following the pure and tolerant way of the haneefs. And seek the help of Allah. O Allah, guide us to Your straight path.”
At the end of his life, al-Ghazzali (rahimahullah) returned to the belief of Ahlus-Sunnah wal-Jama'ah. He focused on the Qur'aan and the Sunnah and condemned Ilmul-Kalaam and its proponents. He advised the Ummah to come back to the Book of Allah and the Sunnah of His Messenger , and to act in accordance with them as was the way of the Sahabah.
Shaikhul-Islam Ibn Taymiyyah (rahimahullah) said, "After that he (al-Ghazzali) came back to the path of the scholars of hadeeth and wrote Iljaam al-Awwaam an Ilm al-Kalaam."
[Siyar A'laam an-Nubula (19/340]
[Majmoo (4/72)]
A glance at 'Iljaam al-Awwaam an Ilm al-Kalaam ' will prove to us that al-Ghazzali had indeed changed in many ways:
1. In this book he advocated the belief of the salaf and pointed out that the way of the salaf was the truth, and that whoever went against them was an innovator or follower of bidah.
2. He emphatically denounced ta'weel (interpretation of the Attributes of Allah in a manner that differs from their apparent meaning). He advocated affirming the Attributes of Allah and not misinterpreting them in a manner that would lead to denying the attributes of Allah.
3. He emphatically denounced the scholars of Ilmul-Kalaam and described all their principles and standards as reprehensible innovations, which had harmed a great number of people and created trouble for the Muslims. Al-Ghazzali said, "The harm caused to a great number of people is something that has been seen, witnessed and experienced. The evil that has resulted since Ilmul-Kalaam began has become widespread, even though people at the time of the Sahabah forbade that. This is also indicated by the fact that the Messenger and the Sahabah, by consensus, did not follow the way of the scholars of Ilmul-Kalaam when they produced arguments, evidence and analysis. That was not because they were incapable of doing so. If they had thought that it was something good, they would have done it in the best manner, and they would have studied the matter hard, more than they did with regard to the division of the estate among the heirs.”
(Now I, Muslim- continue) ..
Some however say he still had a remaining of beliefs on certain issues from here and there..
They'd quote his closest companion, Abu Bakr ibn al-Arabi who refuted his ideas saying, "Our shaykh Abu Haamid went deep into philosophy then he wanted to come out of it but he was unable to. There were narrated from him opinions which sound like the Baatini way of speaking, and that may be verified by looking in al-Ghazzali's books."
The point isnt his beliefs towards the end of his life, but that he went through many stages in his life, embracing something, then writing a book refuting it and so on. So this should always be taken into consideration when quoting him.