It is of Shirk to perform a (righteous) deed for
worldly reasons
Allaah (سُبحانه وتعالى) said:
مَن كَانَ يُرِيدُ الْحَيَاةَ الدُّنْيَا وَزِينَتَهَا نُوَفِّ إِلَيْهِمْ أَعْمَالَهُمْ فِيهَا وَهُمْ فِيهَا لاَ يُبْخَسُونَ
"Whosoever desires the life of the world & its glitter; to them We shall pay in full (the wages of) their deeds therein & they will have no diminution therein."
(Hud 11:15)
أُوْلَـئِكَ الَّذِينَ لَيْسَ لَهُمْ فِي الآخِرَةِ إِلاَّ
النَّارُ وَحَبِطَ مَا صَنَعُواْ فِيهَا وَبَاطِلٌ مَّا كَانُواْ يَعْمَلُونَ
They are those for
whom there is nothing in the Hereafter but Fire; & vain are the deeds they
did therein. And of no effect is that which they used to do.
(Hud 11:16)