أُو۟لَـٰٓئِكَ ٱلَّذِينَ كَفَرُوا۟ بِـَٔايَـٰتِ رَبِّهِمْ وَلِقَآئِهِۦ فَحَبِطَتْ أَعْمَـٰلُهُمْ فَلَا نُقِيمُ لَهُمْ يَوْمَ ٱلْقِيَـٰمَةِ وَزْنًا Qur’an Al-Kahf (18:105)Olaika allatheena kafaroo biayati rabbihim waliqaihi fahabitat aAAmaluhum fala nuqeemu lahum yawma alqiyamati waznan
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!