Sayyiduna Abu Hurayrah (may Allah be pleased with him) narrated that a man said to the Messenger of Allah (peace and blessings be upon him): A person intends jihad in the way of Allah while wanting to gain worldly wealth. He (peace and blessings be upon him) said: "There is no reward for him." Then that man asked again a second and a third time, and he (peace and blessings be upon him) still said: "There is no reward for him."
The Shaykh said: This hadith carries the possibility that he intended only the world; but as for the one who intends reward and hopes to obtain spoils (there is no sin on him).
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / 18551