That is because they pursued what displeases Allah, and they disliked His approval, so He nullified their works.