Allah Rewards According To Intentions
[Allah’s Quran – 2:225] “Allah will not call you to account for thoughtlessness in your oaths, but for the intention in your hearts; and He is Oft-forgiving, Most Forbearing.”
The Prophet (peace be upon him) has said: [Bukhari, Book #1, Hadith #1] “Narrated ‘Umar bin Al-Khattab: I heard Allah’s Apostle saying, “The reward of deeds depends upon the intentions and every person will get the reward according to what he has intended. So whoever emigrated for worldly benefits or for a woman to marry, his emigration was for what he emigrated for.” (Book #1, Hadith #1)
[Muslim, Book #020, Hadith #4692] “It has been narrated on the authority of Umar b. al-Khattab that the Messenger of Allah (may peace be upon him) said: (The value of) an action depends on the intention behind it. A man will be rewarded only for what he intended. The emigration of one who emigrates for the sake of Allah and His Messenger (may peace be upon him) is for the sake of Allah and His Messenger (may peace be upon him), and the emigration of one who emigrates for gaining a worldly advantage or for marrying a woman is for what he has emigrated.”
[Abudawud, Book #20, Hadith #3105] Narrated Jabir ibn Atik: “The Apostle of Allah (peace be upon him) said: Allah Most High gave him a reward according to his intentions.”
[Al-Bukhari and Muslim] Abdullah bin ‘Abbas (May Allah be pleased with them) reported: Messenger of Allah (SWT) said that Allah, the Glorious, said: “Verily, Allah (SWT) has ordered that the good and the bad deeds be written down. Then He explained it clearly how (to write): He who intends to do a good deed but he does not do it, then Allah records it for him as a full good deed, but if he carries out his intention, then Allah the Exalted, writes it down for him as from ten to seven hundred folds, and even more. But if he intends to do an evil act and has not done it, then Allah writes it down with Him as a full good deed, but if he intends it and has done it, Allah writes it down as one bad deed”.
Everything we do has to be intended for the sake of Allah (SWT). A good action with the wrong intention will not get us any reward in the Hereafter