If it was slaughtered purely for the meat, as is the basic reason for which people slaughter animals, then it must be done in the name of Allah. If the name of Allah was mentioned over it, it is permissible to eat it, if it was slaughtered in the well-known shar‘i manner. If the name of Allah was not mentioned over it, it is not permissible to eat it. Allah says (interpretation of the meaning):
“So eat of that (meat) on which Allaah’s Name has been pronounced (while slaughtering the animal), if you are believers in His Ayaat (proofs, evidences, verses, lessons, signs, revelations, etc.).
119. And why should you not eat of that (meat) on which Allaah’s Name has been pronounced (at the time of slaughtering the animal), while He has explained to you in detail what is forbidden to you, except under compulsion of necessity? And surely, many do lead (mankind) astray by their own desires through lack of knowledge. Certainly your Lord knows best the transgressors”
“Eat not (O believers) of that (meat) on which Allaah’s Name has not been pronounced (at the time of the slaughtering of the animal), for sure it is Fisq (a sin and disobedience of Allaah). And certainly, the Shayaateen (devils) do inspire their friends (from mankind) to dispute with you, and if you obey them[by making Al‑Maytah (a dead animal) legal by eating it], then you would indeed be Mushrikoon (polytheists); [because they (devils and their friends) made lawful to you to eat that which Allaah has made unlawful to eat and you obeyed them by considering it lawful to eat, and by doing so you worshipped them; and to worship others besides Allaah is polytheism]”
But if what is intended by slaughtering it is an act of worship, then added to the above conditions is that this sacrifice should have been done for Allah, like all other acts of worship. Allah says (interpretation of the meaning):
“Say (O Muhammad صلى الله عليه وسلم): ‘Verily, my Salaah (prayer), my sacrifice, my living, and my dying are for Allaah, the Lord of the ‘Aalameen (mankind, jinn and all that exists).
163. He has no partner. And of this I have been commanded, and I am the first of the Muslims’”
Ibn Katheer (may Allah have mercy on him) said:
Here Allah is commanding him (the Prophet (blessings and peace of Allah be upon him)) to tell the mushrikeen who worship gods other than Allah and offer sacrifices that are not done in His name, that he differs from them in that; his prayer is for Allah, his sacrifice is in His name alone with no partner or associate. This is like the verse in which Allah says (interpretation of the meaning): “Therefore turn in prayer to your Lord and sacrifice (to Him only)” [al-Kawthar 108:2], i.e., make your prayer and sacrifice sincerely for Him alone. The mushrikeen used to worship idols and offer sacrifices to them, so Allah commanded him to be different from them and turn away from their path, and turn with a sincere intention and devotion to Allah alone. End quote.
Tafseer Ibn Katheer (3/381-382)
Muslim (1978) narrated that ‘Ali ibn Abi Taalib (may Allah be pleased with him) said: The Messenger of Allah (blessings and peace of Allah be upon him) said: “May Allaah curse the one who offers a sacrifice to anything other than Allaah.”
Al-Nawawi (may Allah have mercy on him) said:
What is meant by offering a sacrifice to anything other than Allah is that which is slaughtered in the name of anything or anyone other than Allah, such as a sacrifice offered to an idol or the cross or Moosa or ‘Eesa (blessings and peace of Allah be upon them both) or to the Ka‘bah and so on. All of that is haraam and this meat is not halaal, whether the one who slaughtered it is a Muslim or Christian or a Jew. That was stated by al-Shaafa‘i and agreed upon by our companions. If he also intended it as an act of veneration or worship of the one other than Allah to whom he slaughtered it, that is kufr. If the one who slaughtered it was a Muslim before that, he becomes an apostate because of this slaughter. End quote.
The one who slaughters a sacrifice for anyone or anything other than Allah, such as one who slaughters it for an idol or to ward off evil spirits -- as they claim -- or to draw close to whatever he worships instead of Allah or to a “saint” (wali) and so on is a mushrik who is beyond the pale of Islam and it is not permissible to eat meat slaughtered by him, whether he mentioned the name of Allah over it or not, because he slaughtered it as a sacrifice to someone other than Allah, and Allah says (interpretation of the meaning):
“He has forbidden you only the Maytah (dead animals), and blood, and the flesh of swine, and that which is slaughtered as a sacrifice for others than Allaah (or has been slaughtered for idols, on which Allaah’s Name has not been mentioned while slaughtering). But if one is forced by necessity without willful disobedience nor transgressing due limits, then there is no sin on him. Truly, Allaah is Oft-Forgiving, Most Merciful”
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said:
The apparent meaning of the words “and that which is slaughtered as a sacrifice for others than Allaah” is that whatever is slaughtered for anyone or anything other than Allah, such as if it is said, This is a sacrifice to such and such, and this is the intention, whether the person spoke it out loud or not, is haraam, and the prohibition in this case is clearer than the prohibition on that which was slaughtered by a Christian for meat over which he said the name of Christ and so on. That which we slaughter as an act of worship to draw close to Allah is pure and better than that which we slaughter for meat and mention the name of Allah over, because worshipping Allah by praying to Him and sacrificing to Him is better than seeking help by saying His name at the beginning of every action. By the same token, shirk that involves praying to anyone other than Allah and offering sacrifices to anyone other than Him is worse shirk than seeking help in the name of this other “god” at the beginning of every action. If that over which the name of Christ or al-Zahrah is mentioned is haraam, then that which is sacrificed to Christ or al-Zahrah or is intended as such is even more haraam. Based on that, if something is slaughtered for someone other than Allah as an act of worship to draw close to him, it is haraam, even if the name of Allah is mentioned over it, as some of the hypocrites of this ummah do, who seek to draw close to the “saints” (awliya’) and stars by offering sacrifices, burning incense and so on. If these people are apostates, then meat slaughtered by them is not permissible under any circumstances, because both reasons are combined in this case
End quote from Iqtida’ al-Siraat al-Mustaqeem, 260
The scholars of the Standing Committee said:
Offering a sacrifice to anyone or anything other than Allah is shirk, and the meat comes under the same rulings as maytah (dead meat), and it is not permissible to eat it even if the name of Allah is mentioned over it, if it is established that it was slaughtered for anyone or anything other than Allah. End quote.
Fataawa al-Lajnah al-Daa’imah, 1/226
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said:
Offering a sacrifice to anyone or anything other than Allah is major shirk, because sacrifice is an act of worship, so the one who offers a sacrifice to anyone or anything other than Allah is a mushrik whose shirk puts him beyond the pale of Islam -- whether he sacrifices that to one of the Angels or one of the Messengers or one of the Prophets or one of the caliphs or one of the awliya’ (saints) or one of the scholars. All of that is associating others with Allah, may He be glorified and exalted, and puts one beyond the pale of Islam.
With regard to eating the meat of these sacrifices, it is haraam, because it was sacrificed to something or someone other than Allah, and everything that is sacrificed to something or someone other than Allah, or was sacrificed on a stone altar, is haraam. End quote.
Majmoo‘ Fataawa Ibn ‘Uthaymeen, 2/148
If this Muslim slaughterman knew that this animal that he slaughtered was being slaughtered for someone or something other than Allah, even if he mentioned the name of Allah over it, this is major shirk as stated above. If he slaughtered it and did not know that, rather he was asked to slaughter it and he did so, thinking that they were slaughtering it for meat, then there is no blame on him.
And Allah knows best.
See also the answer to question number 44730.