1) GIVING TZEDAKAH IN ORDER TO RECEIVE REWARD
QUESTION: The Gemara says that a person who donates money and says, "I hereby give this money to Tzedakah in order that my child be healed" or "in order that I merit a share in Olam ha'Ba," is considered a complete Tzadik and has fulfilled the Mitzvah of giving Tzedakah perfectly.
How can he be considered to have performed the Mitzvah perfectly if he does it with intention to receive reward? The Mishnah in Avos (1:2) clearly says, "Do not be like a servant who serves his master on condition to receive payment." Why does the Gemara call such a person a "complete Tzadik" who fulfills the Mitzvah perfectly?
(a) TOSFOS in many places explains, based on the Gemara here, that only when the person intends to give the Tzedakah in any event, whether or not the child recuperates, is he considered a complete Tzadik. He gives the Tzedakah wholeheartedly, and he merely appends to his act a prayer that in the merit of giving Tzedakah his child should be healthy. This is not considered serving one's master in order to receive payment. The Mishnah in Avos refers to one who performs the Mitzvah only in order to receive reward.
(b) TOSFOS RABEINU PERETZ suggests that the Mishnah in Avos, which says that a person should not serve Hash-m like a servant who serves his master with intent to receive payment, does not mean that it is a bad trait to do so. There is nothing inherently wrong with serving Hash-m in order to receive reward. Rather, one who serves Hash-m in this way merely has not yet reached the level of a Chasid, one who fulfills the Mitzvos only in order to do the will of Hash-m with no ulterior motives. When the Gemara says that he is a complete Tzadik, it means he is only a Tzadik, but not yet a Chasid.
(c) The TUR (YD 247) says that although normally one may not test Hash-m by saying that he will do a Mitzvah to see if Hash-m will reward him for it, he is permitted to test Hash-m with the Mitzvah of Tzedakah by saying that he gives Tzedakah in order to see if Hash-m will reward him for it. Accordingly, the Mitzvah of Tzedakah also might be an exception to the rule expressed in Avos that a person should not serve Hash-m in order to receive reward. One is permitted to test Hash-m when he gives Tzedakah because the reward for this Mitzvah is certain; Hash-m promises to give reward to those who give Tzedakah (see Malachi 3:10, Devarim 15:10). Therefore, perhaps one is called a complete Tzadik even if he gives Tzedakah in order to receive reward. (RAV ELIEZER LANDA, in a note printed in the Vilna Shas to Tosfos here, DH Bishvil. When the TUR mentions this difference between Tzedakah and other Mitzvos, he does not say it in the context of the Gemara here.)
However, the BEIS YOSEF and the REMA point out that the Gemara in Ta'anis (9a), which seems to be the source for the Tur's words, implies that not all types of Tzedakah result in definite reward. Hash-m's promise to give reward applies only to the Tzedakah of Ma'aser given to the Leviyim. The other Acharonim agree with this point, as cited by the PISCHEI TESHUVAH. Accordingly, the Tur's words do not suffice to explain the Gemara here which is not discussing Ma'aser. (See also Insights to Pesachim 8:1 and Kesuvos 67:1.)
2) HOW TO BECOME A PERFECT TZADIK
QUESTION: The Gemara says that a person who gives Tzedakah on condition that he be rewarded with some personal benefit is considered a "Tzadik Gamur," a complete Tzadik.
Even if such a donation is considered a righteous act, how can the performance of a single good deed make a person a "Tzadik Gamur"? How can it cleanse him of all of his sins, and how can his fulfillment of one Mitzvah be considered fulfillment of all of the Mitzvos of the Torah)?
(a) RASHI here writes that he is a Tzadik Gamur "if he does this often" ("Im Ragil b'Kach"). RAV YAKOV EMDEN writes that Rashi's intention is to answer the question posed above. A person who utilizes every excuse available as another reason to give Tzedakah shows that he is a Tzadik Gamur. The fact that he turns to Hash-m whenever he is in need demonstrates that he knows that everything comes from Hash-m. This is the trait of a Tzadik Gamur.
(b) RASHI elsewhere (Bava Basra 10b, Pesachim 8b) offers a different explanation. He says that a person who gives Tzedakah in this manner is a Tzadik Gamur "in the performance of this deed." This means that although he performs the Mitzvah of Tzedakah in the best possible way, his conduct in matters of Tzedakah does not reflect his level of piety in other matters.
(c) RABEINU CHANANEL here cites others who explain that the Gemara does not mean that the person is a Tzadik Gamur, but rather that the act is one of "Tzedakah Gemurah" (or "Tzedek Gamur"). The subject of the Gemara is not the person, but the act. The Gemara teaches that this form of giving is a perfect act of Tzedakah and should not be discredited. This is also the explanation of the TOSFOS HA'ROSH and the ARUCH (Erech "Tzedek") in the name of RABEINU MOSHE HA'DARSHAN.