The Prophet said: "Whoever seeks knowledge for a reason other than the sake of Allah, or intends it for a purpose other than for the sake of Allah, let him take his place in hell."
أَنَّ النَّبِيَّ ﷺ قَالَ مَنْ طَلَبَ الْعِلْمَ لِغَيْرِ اللَّهِ أَوْ أَرَادَ بِهِ غَيْرَ اللَّهِ فَلْيَتَبَوَّأْ مَقْعَدَهُ مِنَ النَّارِ