Please contribute generously in order to ensure the continuity of our website InshaAllah.
Praise be to Allah.
The ruling on offering the funeral prayer for one who did not pray is based on the difference of opinion among the scholars as to whether he is a Muslim who is a sinner or a kaafir. The apparent meaning of the texts and the consensus of the Sahaabah (may Allaah be pleased with them) is that the one who does not pray is a kaafir in the sense of major kufr. This has been discussed in the answer to question no. 10061. In the answer to question no. 70278 we stated that if a person does not pray, we cannot eat meat slaughtered by him. In the answer to question no. 37820 and 49698 we stated that if a person does not pray, no good deeds, zakaah, fasting, Hajj or anything will be accepted from him. In the answer to question no. 7864 we stated that the Muslims should have their own graveyards, in which no one else should be buried, and the one who does not pray and dies when he is not praying should not be buried in the Muslim graveyard.
At the same time, we cannot deny that there is another scholarly opinion on this issue, and there is nothing wrong with the one who adopts it and believes in it.
If you think that the one who does not pray is a kaafir, then do not offer the funeral prayer for one who died when he was not praying, and put up with any trouble that may be caused to you by the foolish.
If you do not think that the one who does not pray is a kaafir, then there is nothing wrong with you offering the funeral prayer for one who died when he was not praying, although it is better not to offer the prayer for him, as a punishment to him and as a deterrent to others from this major sin. Perhaps by not offering the funeral prayer for him and others like him, you will motivate people to establish regular prayer.
And Allaah knows best.