In the laws of sacrifices we have a strange concept known as PIGUL. When the officiating Kohen or the owner of the Korban have intentions to eat the Korban beyond the time prescribe by the Torah, the Korban immediately becomes void and the owner must bring a different one. What makes this strange is that if they had no such intentions when the sacrifice was offered but instead if when the time came they left some of the Korban meat over beyond the time permitted for it to be eaten it becomes known as Notar (left over) and has to be burnt but a new Korban does not have to be brought. The owner who brought that sacrifice fulfilled his obligation. The obvious question is why is it worse to think that the Korban will be eaten beyond the permitted time than if it is actually left over beyond that time.
The answer could be in the real feelings of the owner who offers the sacrifice. The Torah has complete instructions on how the Korban has to be brought. The Torah tells us where it may be eaten and until when it may be eaten. If a person follows these regulations but happens to leave over meat beyond the time, willingly or unintentionally, he in effect brought his Korban and fulfilled his obligation. If, however, on the other hand, when he brings it he already has intentions of not following the law then he is flaunting the word of the Torah and is making his own rules. That is not acceptable.
When we do a good deed, when we make a major donation, when we help someone, or when we perform any kind act, our intentions are very essential. Our objective should be satisfying the need or the Mitzvah and not the glory or the credit we get for doing it.