Perfection is an attribute particular to Allah alone. Even the prophets who had profound faith and whose moral excellence is praised in the Qur’an were not above human error. Believers are advised to avoid these kinds of errors. Throughout the Qur’an, Allah commands the prophets and all believers to seek His forgiveness because intentionally or not, people commit sins. This is a clear sign that man is weak, vulnerable, and in need of Allah, even while observing the limits set by Him.
The responsibility of a believer is to repent once he recognizes his mistakes and sins, seek forgiveness and be careful not to repeat them. But this is not to make yourselves appear sinless and without error or to prove your innocence; such an attitude is not pleasing to Allah:
To whoever avoids the major wrong actions and indecencies -except for minor lapses- truly your Lord is vast in forgiveness. He has most knowledge of you when He first produced you from the earth, and when you were embryos in your mothers’ wombs. So do not claim purity for yourselves. He knows best those who guard against evil. (Surat an-Najm; 32)
The reason a person pretends to be righteous is his desire for distinction or eminence. However, such a person actually degrades himself both in Allah’s Sight and in the eyes of believers. In one sense, even if it is not overt, his claims to being superior are an invention of his own making, and this is discomforting to the heart of a sincere Muslim. He foolishly thinks he has deceived believers and attained value and worth in their sight, but he does not realize that he is pitiful and being treated with indulgent patience. Shortly afterwards, he really starts to believe that he is perfect, and day by day his behavior becomes more humiliating.
He may even begin to believe he is infallible, and if he regards himself as sinless, a person does not feel the need to ask for forgiveness from Allah. He becomes arrogant and thus virtually molds himself into an idol (Allah is surely beyond that). This is his certain downfall.
A sincere believer, on the other hand, is aware of his errors and continuously asks for forgiveness from Allah. He constantly hopes for Allah's mercy and approval. Therefore, Allah conceals his faults, forgives his sins, purifies his soul, and makes him a superior person.
Do you not see those who claim to be purified? No, Allah purifies whoever He wills. They will not be wronged by so much as the smallest speck. (Surat an-Nisa’; 49)