Ruling on doing righteous deeds with the aim of worldly gain
Conclusion: Whoever does acts of worship and righteous deeds with the sole aim of worldly gain will have no share of reward with Allah (such as one who gives charity only so that he might be healed, or who recites Soorat al-Baqarah only so that she might get married, or who fasts only for the purpose of dieting, or who joins the Muslim army only for the sake of booty, or who goes for Hajj only for the purpose of trade. But if someone intends to seek the pleasure of Allah and the hereafter, and makes worldly gain a secondary factor, not the main focus, there is no blame on him. And Allah knows best.
40,326