Sins in Islam can be explained as in the following quote from Reading Islam:
Sin, from the point of view of Islam, is a conscious and willful act that violates a commandment of God or the right of a fellow being. We cannot consider a person to be a sinner if he or she acts under duress or out of ignorance. Because, human accountability is an important aspect of justice as envisaged in Islam. And no one can be truly held accountable for an action he has no power to avoid. Because, God does not lay more burden on a human than he can bear. Islam teaches that sin is an avoidable act that harms the perpetrator's own soul. This means that there is no innate or inherited nature that prompts a person to disobey God. That is to say, it is a person's free choice whether to sin or not; and one's disposition to sin is only as much as, if not less than, their inclination to do good. One important teaching of Islam as taught by the Prophet is this hadith:
"Deeds are but by intentions and every person shall have what he intended." (Al-Bukhari and Muslim)
This means that a person's motive should be taken into consideration when we judge his or her actions. And we know that motive is something that is in the mind of the people and even if they speak out why they have acted in a particular way, we have no means of verifying their claim.
Question:
Does Allah accept the good deeds of adulterous people or not? Does adultery make good deeds profitless? Can an adulterer who keeps on doing this evil action, have good deeds, or they will not be accepted until he repents to Allah? Does Allah accept the fasting and prayers of an adulterer? Knowing that the prophet, peace be upon him said what means that the doors of heavens open after midnight and a caller calls saying, will anyone pray so that his prayers will be accepted, will anyone ask for something so that it will be given to him, is there anyone in distress so that Allah relieves it, then there would be no Muslim asking Allah for anything except that it will be given to him, except an adulterer who earns by his genitals, and a man who takes taxes unfairly. It is mentioned in the above hadeeth also that Allah will make their good deeds like scattered floating particles of dust, because they commit what Allah forbade. Please clarify this matter and how authentic is this hadeeth?
Answer:
Praise be to Allaah.One of the well-established facts that is affirmed by the Qur’aan and on which Ahl al-Sunnah are unanimously agreed is that sins and major sins do not erase all of the good deeds of the Muslim, and that there is nothing that erases the good deeds of a Muslim altogether except kufr and shirk. This is indicated by the verse in which Allaah says (interpretation of the meaning):
“And whosoever of you turns back from his religion and dies as a disbeliever, then his deeds will be lost in this life and in the Hereafter, and they will be the dwellers of the Fire. They will abide therein forever”
[al-Baqarah 2:217]
Shaykh al-Islam Ibn Taymiyah (may Allaah have mercy on him) said in Majmoo’ al-Fataawa (10/321-322):
The Sahaabah and Ahl al-Sunnah wa’l-Jamaa’ah are of the view that those who commit major sins will be brought forth from Hell and intercession will be made for them. A single major sin does not erase all good deeds, but it may erase an equivalent amount of them, according to most of Ahl al-Sunnah. Nothing erases all good deeds except kufr, just as nothing erases all bad deeds except repentance. If the one who has committed a major sin does some good deeds, seeking thereby the pleasure of Allaah, Allaah will reward him for that, even if he deserves to be punished for his major sin. The Book of Allaah distinguishes between the ruling on thieves, adulterers and believers fighting with one another, and the ruling on the kuffaar with regard to how they are labelled and the ruling applicable to them. The mutawaatir Sunnah of the Prophet (peace and blessings of Allaah be upon him) and the consensus of the Sahaabah points to that. According to Ahl al-Sunnah wa’l-Jamaa’ah, good deeds are accepted from the one who fears Allaah and does them purely for the sake of Allaah and in accordance with the command of Allaah. If a person is sincere towards Him in doing an action, He will accept it from him, even if he disobeys Him in other ways; if a person is not sincere towards Him when doing it, He will not accept it from him, even if he obeys Him in other ways. End quote.
The hadeeth which is mentioned in the question is the hadeeth narrated by Thawbaan (may Allaah be pleased with him) from the Prophet (peace and blessings of Allaah be upon him) who said: “I certainly know people of my ummah who will come on the Day of Resurrection with good deeds like the mountains of Tihaamah, but Allaah will make them like scattered dust.” Thawbaan said: O Messenger of Allaah, describe them to us and tell us more, so that we will not become of them unknowingly. He said: “They are your brothers and from your race, worshipping at night as you do, but they will be people who, when they are alone, transgress the sacred limits of Allaah.”
Narrated by Ibn Majaah in his Sunan (no .4245); al-Rawiyaani in al-Musnad (1/425); al-Tabaraani in al-Awsat (5/46) and al-Sagheer (1/396); Musnad al-Shaamiyeen (no. 667); al-Daylami in Musnad al-Firdaws (7715). Classed as saheeh by al-Albaani in al-Silsilah al-Saheehah (505).
This is evidence that supports the principle we have mentioned, which is that some bad deeds may cancel out a portion of a person’s good deeds and of the reward for his righteous needs.
For more information on what we have mentioned about this issue, please see the answer to question no. 81874.
With regard to the second hadeeth you mentioned, it is the hadeeth of ‘Uthmaan ibn Abi’l-‘Aas al-Thaqafi, according to which the Prophet (peace and blessings of Allaah be upon him) said:
“The gates of heaven are opened halfway through the night and a caller cries out: Is anyone supplicating so that he may be answered? Is anyone asking so that he might be given? Is anyone in distress, so that he might be granted relief? And there will be no Muslim left who is supplicating but Allaah will answer him, except for a zaaniyah who earns a living from committing zina or an extortionist.”
Narrated by al-Tabaraani in al-Mu’jam al-Kabeer (9/59) and in al-Mu’jam al-Awsat (3/154). Al-Haythami said in Majma’ al-Zawaa’id (10/156): Its men are the men of saheeh. Al-Albaani said in al-Silsilah al-Saheehah 91073): Its isnaad is saheeh.
Based on this, there is no suggestion that all his good deeds will be erased, rather it shows that the du’aa’ of the adulterer (zaani) who is persisting in his zina will not be accepted, and this is a valid meaning. Major sins are one of the impediments to du’aa’ being accepted. How can Allaah respond to one who is remaining in sin and not giving it up or repenting from it?
And Allaah knows best. Source: Islam Q&A