أُو۟لَـٰٓئِكَ ٱلَّذِينَ كَفَرُوا۟ بِـَٔايَـٰتِ رَبِّهِمْ وَلِقَآئِهِۦ فَحَبِطَتْ أَعْمَـٰلُهُمْ فَلَا نُقِيمُ لَهُمْ يَوْمَ ٱلْقِيَـٰمَةِ وَزْنًا Qur’an Al-Kahf (18:105)Ol a ika alla th eena kafaroo bi a y a ti rabbihim waliq a ihi fa h abi t at aAAm a luhum fal a nuqeemu lahum yawma alqiy a mati wazn a n
Although each of their good actions will be taken into account on Judgment Day in accordance with the Qur'anic statement that "he who shall have done an atom's weight of good, shall behold it" ({99: 7}), the above verse implies that whatever good such sinners may do is far outweighed by their godlessness (Al-Qadi 'Iyad, as quoted by Razi).
What weight can be attached to works behind which the motives are not pure, or are positively evil? They are either wasted or count against those who seek to pass them off as meritorious!