That is because they followed that which angered Allah, and hated that which pleased Him. So He made their deeds fruitless.