Muhammad • EN-AL-JALALAYN
﴿ ذَٰلِكَ بِأَنَّهُمُ ٱتَّبَعُوا۟ مَآ أَسْخَطَ ٱللَّهَ وَكَرِهُوا۟ رِضْوَٰنَهُۥ فَأَحْبَطَ أَعْمَٰلَهُمْ ﴾
“This, because they were wont to pursue what God condemns and to hate [whatever would meet with] His goodly acceptance: and so He has caused all their [good] deeds to come to nought.”
That taking of them away in the state mentioned is because they followed what angers God and because they were averse to what pleases Him that is to say they were averse to doing what pleases Him. Therefore He has made their works fail.