According to several ahadith...
According to several ahadith, Allah (awj) strengthens the prophets and Imams through the Pure Spirit, the Spirit of Faith, the Spirit of Strength, the Spirit of Lust, and the Lofty Spirit. Now that we have defined infallibility, we turn to an analysis of the intellectual and textual proofs for the existence of this trait in certain individuals.
As a preliminary note, when examining the verses of the Qur`an concerning the infallibility of the prophets, it is important to keep in mind that Divine revelation can never contradict human reason. Therefore, we must read these verses in light of reason, so that no contradictions occur. With respect to the infallibility of the prophets, we will mention only one rational proof.
Al-Shaykh al-Tusi, in a very terse statement, says, “Infallibility is necessary for a prophet so that surety in him is attained, and as a result, the purpose of creation is fulfilled.” In other words, a prophet must be infallible so that mankind can trust the revelation that he brings.
Some scholars have expressed this proof in the following way: “Once the intellect independently accepts the existence of Allah and the logical possibility of revelation and prophethood (in a general sense, not as pertains to any specific prophet), the intellect then affirms the necessity of the infallibility of the prophets in receiving and conveying divine revelation.
The evidence for this is that since Allah has sent his prophets to guide mankind, he must send a person who is neither careless nor forgetful, much less sinful. If not, He will contradict His own purpose in sending prophets, revelation, and in essence, the purpose of creation itself. If the prophets were capable of carelessness, forgetfulness, or sin, people would never fully trust that what they say is from Allah.
They would always entertain the possibility that the prophets have lied to them or made a mistake or misunderstood Allah’s intent.” This theological principle is firmly based on the attributes of Allah (awj) himself. In particular it is based on His omniscience (‘ilm) , omnipotence (qudrah) , the purposefulness of His actions (hikmah) — both in creation and legislation — and in essence, on the fact that He is free from impropriety, injustice, and purposelessness.
If a prophet were to make a mistake in receiving or conveying revelation, this mistake would demonstrate either ignorance, weakness, or incompetence in Allah’s (awj) actions.