This statement is from Imam Ghazali’s book “al-iqtisad fi al-itiqad” which is rendered into English with title “Moderation in Belief” whose pdf copy is attached with the reply under fair usage permission granted by the publisher (University of Chicago Press). This statement can be found in pages 278-279 of the book and the complete passage reads:
“The fourth rank is the Mutazilites, the anthropomorphists, and all the sects other than the philosophers. These profess belief; think it impermissible [for the messengers] to lie, whether it is for the sake of some interest or not; do nor posit a rationale for lying; and put forth metaphorical interpretations, bur they err in their interpretations. Their status belongs to [those who are engaged in] independent opinion. He who studies independent opinions ought to avoid imputing infidelity [to its practitioners] as much as he can. For rendering violable the lives and properties of those who perform the prayers facing the kiblah and declare that there is no deity but God and that Muhammad is God’s Messenger is a grave matter. To err in leaving one thousand infidels alive is better than to err in shedding even one cup of a Muslim’s blood. The Prophet (may God bless him and grant him peace) says: “I was ordered to fight people until they say that there is no deity but God; if they say it, they make their lives and properties inviolable for me, unless it is rightful to take them.”