?The first of people against whom judgment will be pronounced on the Day of Resurrection will be a man who died a martyr. He will be brought and Allah will make known to him His favours and he will recognize them. will say ?And what did you do about them?? He will say ?I fought for You until I died a martyr.? He will say ?You have lied - you did but fight that it might be said ?He is courageous.?? And so it was said. Then he will be ordered to be dragged along on his face until he is cast into Hell-fire. will be a man who has studied knowledge and has taught it and who used to recite the Qur?an. He will be brought and Allah will make known to him His favours and he will recognize them. will say ?And what did you do about them?? He will say ?I studied knowledge and I taught it and I recited the Qur?an for Your sake.? He will say ?You have lied - you did but study knowledge that it might be said ?He is learned.?? And you recited the Qur?an that it might be said ?He is a reciter.? And so it was said. Then he will be ordered to be dragged along on his face until he is cast into Hell-fire. will be a man whom Allah had made rich and to whom He had given all kinds of wealth. He will be brought and Allah will make known to him His favours and he will recognize them. will say ?And what did you do about them?? He will say ?I left no path in which You like money to be spent without spending in it for Your sake.? He will say ?You have lied - you did but do so that it might be said ?He is open-handed.?? And so it was said. Then he will be ordered to be dragged along on his face until he is cast into Hell-fire.?
While what is said here isn't doctrinal I must say that this does contain a good warning for ensuring that we be careful of our intentions. A good deed done for a purely selfish reason, in my understanding, is still wrong.