Because he attributed the grace and bounty to himself and not to Allah the Almighty the real Provider.
(He replied, “I have been granted all this because of some knowledge I have.” Did he not know that Allah had already destroyed some from the generations before him who were far superior to him in power and greater in accumulating ˹wealth˺? There will be no need for the wicked to be asked about their sins )[Al-Qasas 28: 78]
لأنه نسب النعمة لنفسه لا لمعطيها سبحانه و تعالى
قَالَ إِنَّمَا أُوتِيتُهُ عَلَىٰ عِلْمٍ عِندِي أَوَلَمْ يَعْلَمْ أَنَّ اللَّـهَ قَدْ أَهْلَكَ مِن قَبْلِهِ مِنَ الْقُرُونِ مَنْ هُوَ أَشَدُّ مِنْهُ قُوَّةً وَأَكْثَرُ جَمْعًا وَلَا يُسْأَلُ عَن ذُنُوبِهِمُ الْمُجْرِمُونَ . . فَخَرَجَ عَلَىٰ قَوۡمِهِۦ فِى زِينَتِهِۦۖ قَالَ ٱلَّذِينَ يُرِيدُونَ ٱلۡحَيَوٰةَ ٱلدُّنۡيَا يَـٰلَيۡتَ لَنَا مِثۡلَ مَآ أُوتِىَ قَـٰرُونُ إِنَّهُ ۥ لَذُو حَظٍّ عَظِيمٍ۬ (٧٩)