This question has been answered in two rational and narrative ways.
If we interpret infallibility in any sense, it is essentially from God, who is free from error and mistake in the shadow of his extensive knowledge, and is free from inappropriate actions due to his wisdom. This very richness of God causes other possibilities to benefit from his richness, to be alive, wise and powerful.
The issue of infallibility also belongs to the category that God, according to expediency, equips a group of His servants, who are the teachers of mankind and the guides of mankind, with the power to avoid sin and remain immune from mistakes.
But the infallibility of the twelve imams is confirmed through transmission.
According to the Hadith of Saqlain, they are equal to the Qur'an, and equality is necessary, since the Qur'an is the word of truth and does not deviate from reality and truth, their counterpart must also be like this, because in Otherwise, they will not be equal to the Qur'an.
In other words, since the Prophet (peace and blessings of Allah be upon him) introduces the Qur'an and the Ahl al-Bayt (peace be upon thim) as a means of guidance until the Day of Resurrection, until both of them reach him by the pool of Kausar, both of them should be immune to mistakes, because it is not possible for people who are the means of guiding mankind until the Day of Resurrection to commit mistakes.
Holy Prophet: "I leave two precious things among you: First, the book of God, in which there is guidance and light. So hold on to the Book of God. The Prophet encouraged and urged on the Book of God and then said: And my Ahl al-Bayt, do not forget God for the rights of my Ahl al-Bayt; Pointing out that you should not forget your divine responsibility towards Ahl al-Bayt"
The verse of purification, which talks about the Ahl al-Bayt (peace be upon them), reminds us that God himself wanted to purify them from all kinds of filth.
إِنّما یُریدُ اللّه لِیُذْهِبَ عَنْکُمُ الرِّجسَ أَهل البَیْتِ وَیُطَهِّرکُمْ تَطهیراً
Indeed Allah desires to repel all impurity from you, O People of the Household, and purify you with a thorough purification.
The will to purify the Ahl al-Bayt (peace be upon them) can be interpreted in two ways:
- A) Legislative and legal will, in the sense that God legally wants them to stay away from evil.
- b) The will to develop, in the sense that purification and purity are mixed with their existence and intertwined with their soul and soul.
Naturally, this will is a special will, because otherwise it will be a broad will that belongs to all. For this reason, we must say that the intention is the will to form and create, that pure factors are embedded in their existence, but at the same time, it has not deprived them of the power to commit sin.