In the course of a discussion about the Persian King Koresh, who was known to have brought sacrifices to God together with prayers on behalf of himself and his children (see Ezra 6:10), the Gemara on our daf quotes a baraita that teaches the virtues of giving tzedaka, even with an ulterior motive. According to the baraita, a person who donates a sum of money so that his children will be healthy or so that he will merit a share in the World-to-Come is considered to be a tzaddik gamur – a full-fledged righteous person.
As can be imagined, the commentaries question why the title of tzaddik gamur is applied to such a person. It would seem more logical to offer that honor to a person who gave charity for altruistic reasons. Moreover, the well-known Mishna in Pirkei Avot (1:3) teaches that a person should serve the Creator like a servant who does not expect any reward from his master.
A simple approach to this can be found in Rabbeinu Hananel, who offers an alternative reading of the Gemara. According to Rabbeinu Hananel, the baraita does not say that the individual is a tzaddik gamur, but rather that the donation is tzedakah gemura – it is considered a legitimate contribution and, that is to say, his desire for reward does not negate the value of his act.
Rashi adds the words im ragil bekakh – if he makes a habit of such donations. According to this approach, one who regularly gives tzedaka and makes receiving a reward a condition for his contributions may still be called a tzaddik gamur, as long as he pays no attention to whether or not he actually receives the reward. The Maharal explains that we must take into account the person’s intention when making the donation. A person who sees his donation mainly as an “investment,” on which he expects a return, cannot be considered a tzaddik gamur. If he gives the tzedaka for the sake of Heaven and simply hopes and prays that it will play a role in making him deserving of reward, such a person can be considered a tzaddik gamur.
Finally, the Ran suggests in his derashot that we must distinguish between a tzaddik and a hasid, a pious person. Someone who gives charity – even with ulterior motives – has done what he is obligated to do and is considered righteous. To be considered pious – which is the level expected by the Mishna in Pirkei Avot – a person must be pure of mind and intention..