Praise be to Allah.
The Muslim is obliged to adhere to the teachings of his religion and perform the obligatory duties of praying, fasting, honouring his parents, upholding the ties of kinship, speaking truthfully and other duties that Allaah has enjoined upon him.
He must also avoid that which has been forbidden, such as zina (unlawful sexual relations), riba (usury or interest), drinking alcohol, disobeying parents, lying, treachery, consuming people’s wealth unlawfully and other forbidden things.
This is obligatory upon every Muslim. Whoever adheres to that will be close to Allaah and beloved to Him, and is promised admittance to Paradise and being honoured by Him.
Those who neglect the obligatory duties or commit forbidden actions fall into two categories:
1 – Those whose sin reaches the level of kufr (disbelief) and shirk (associating others with Allaah), such as mocking the faith, insulting Allaah, insulting His Messenger, denying any of the well known tenets of Islam, or regarding as permissible something that Allaah has forbidden, such as regarding wine, adultery or pork as permissible. Whoever does that is an apostate from Islam, but if he does that out of ignorance or negligence, then he should be taught, advised and reminded, so that he may repent to Allaah. If he persists in that after being taught, then he is an apostate who is beyond the pale of Islam.
2 – Those who commit some sins that are not regarded as kufr or shirk, such as adultery or drinking wine, without regarding that as being permissible. If such a person repents, Allaah will accept his repentance and turn his bad deeds into good deeds. But if he persists in his sin, then Allaah warns him of the painful punishment on the Day of Resurrection, and of punishments in this world, such as poverty, sickness, humiliation and defeat, as well as having the hadd punishment carried out on him when committing some crimes, such as drinking alcohol or committing adultery, if it is proven that he committed the crime, and subject to certain conditions that we do not have room to discuss here.
The Muslims’ duty towards those who commit sin is to advise them and call them to repent, and remind them of the danger of sin and the evil consequences thereof, as well as hating them because of their sin.
The obedient and the disobedient are not equal before Allaah, or before His believing slaves, as Allaah says (interpretation of the meaning):
“Shall We treat those who believe (in the Oneness of Allaah –– Islamic Monotheism) and do righteous good deeds as Mufsidoon (those who associate partners in worship with Allaah and commit crimes) on earth? Or shall We treat the Muttaqoon (the pious) as the Fujjaar (criminals, disbelievers, the wicked)?”
But if a sinner does both good and evil, and does both acts of obedience and acts of disobedience – and chief among goodness is belief in Allaah – then the justice and mercy of sharee’ah dictates that his good deeds should not ignored or wasted, and he is not to be regarded the same as those who disbelieve in Allaah altogether.
With regard to a Muslim marrying a kaafir woman, this is haraam, unless she is a Jewish or Christian woman, for Allaah has allowed marriage to them, because of the possibility of their being guided to Islam and because these religions share with Islam the belief in Allaah, the Prophets and Messengers, and the Last Day. The marriage of such a woman to a Muslim may lead her to seek the truth and encourage her to give up her disbelief in Muhammad (peace and blessings of Allaah be upon him) and his message.
To sum up:
The Muslim who leaves his religion altogether is as bad as an atheist, or worse.
As for the Muslim who believes in the basics of Tawheed (Oneness of God) and Islam, but he commits major sins and abhorrent actions, he is undoubtedly better than a kaafir and atheist – despite his shortcomings – because the good deed of Tawheed (believing in the Oneness of Allaah) is the best of all good deeds, and he has done that. But he is warned of a painful punishment in this world and the Hereafter for the sins he commits, if Allaah does not bestow His mercy upon him and forgive him.
And Allaah knows best.