As we have seen in the introduction to Masechet Menahot a kometz – a fistful of flour – was taken from most of the meal-offerings that were brought in the Temple and was placed on the altar. The first Mishnah teaches that in most cases, if this was done she-lo lishmah – with improper intentions – the meal-offering remains a valid sacrifice, although it is not credited to the owner of the offering and he will have to bring a replacement for it.
Rashi explains that when the Mishnah says that the kometz was taken with improper intentions it means that at the time that he took the fistful of flour the kohen stated clearly his incorrect intention regarding the kometz. The Rambam, however, indicates that even an inappropriate thought would be enough to affect the status of the offering. At the same time, in Masechet Zevahim (daf, or page, 2b) it is clear that when bringing an animal sacrifice it is only if the kohen has the wrong intention that there will be a problem; if he does not have any specific thoughts, the korban will not be affected.
Our Gemara does not offer any source for the requirement that the meal-offering be brought with appropriate intent. Tosafot suggest that the Mishnah here relies on the rules that were taught regarding animal sacrifices in Masechet Zevahim (see daf 4a) based on the passages about a korban shelamim – a peace-offering – given the connection that the Torah makes among all sacrifices in Sefer Vayikra (7:37).
Some commentaries point out that although there is reason to suggest that there is a major difference between animal sacrifices – where changing a sacrifice from an olah (a burnt offering) to a shelamim (a peace offering) involves a transformation from one level of holiness to another and from one type of atonement to another – while all menahot are largely the same, nevertheless the Torah does distinguish between different menahot in the way they are prepared and gives them different names (see the introduction to this tractate).