Sefer Vayikra, which we start reading this week, primarily discusses halachos of karbanos (sacrifices). The Mishnah in Zivachim 46b discusses the kavanos that one must have while shechting (slaughtering) a karban. The Mishna says that he must have in mind six different kavanos. They are:
1. What type of karban it is, i.e. olah or shilamim etc.;
2. Who the karban is for (the owner);
3. The karban is to Hashem;
4. The entire korban will be brought on the fire;
5. The haktarah (smoking) should be exclusively for re'ach (aroma);
6. and that the aroma is a nachas ruach to Hashem.
The Gemara (Zivachim 2b) says that if one shechts a karban and has no specific intention in mind, the karban is kosher because staman lishmah haim (a karban is automatically lishmah).
The Rambam (Pisulai Hamukdashim 13:1) says that only two of the kavanos can render a karban pasul – #1- if one has the wrong karban in mind, and #2- if one has in mind the wrong owner. If one has in mind the wrong kavanah by the other kavanos, the karban is still kosher. In summary, optimally, there are six kavanos that one should have. If he has nothing in mind, it is still kosher. If he has the wrong thing in mind for two of the six, the karban will be pasul, and with the other four the karban will still be kosher.
There is a famous machlokes in understanding the din of stamah lishmah, and how the wrong thoughts disqualify a karban. The Brisker Rav, Reb Yitzchok Zev Soloveitchik, zt"l, in his sefer on the Rambam (Maiseh Hakarbanos 4:11), says that once one sets aside a karban it will automatically always be lishmah, even if the one bringing it has the wrong machshavos. One's wrong machshavos does not nullify the lishmah set forth by the stamah lishmah; rather it results in a karban that is lishmah, together with wrong machshavos in it as well. A karban with wrong machshavos is pasul, even though it is also lishmah.
This is different than other mitzvos in which the Torah requires lishmah. In other cases the Torah only requires that it be done lishmah. When one has the wrong kavanah, it is not a p'sul; rather the only problem is that it lacks the lishmah. So if we could apply the rule of stamah lishmah, if one has a wrong machshavah it will not be pasul – since you have lishmah, and having the wrong machshavos does not pasul the mitzvah. Only by karbanos did the Torah say that having the wrong machshavos can pasul a karban.
Reb Elchonon Wasserman, zt"l, Hy"d, asks on this p'shat, that Tosafos, in Menachos 42b, seems to disagree. Tosafos says that if one dyes tzitzis for the sake of tzitzis and for the sake of testing the color, the tzitzis is pasul. This is similar, in his view, to that of a karban minchah that was performed lishmah and not lishmah together. We see from Tosafos that having the wrong kavanah by karbanos is comparable to that of other mitzvos. According to the p'shat that the Brisker Rav said in the Rambam, we would not be able to prove for tzitzis that having a wrong kavanah together with the right kavanah is a problem from karbanos. From this Tosafos we see that even by karbanos, having the wrong kavanah is not a positive p'sul. Rather, it makes the karban lack the full, correct kavanah – as is the case by other mitzvos.
Reb Elchonon explains that the purpose of lishmah by karbanos and by mitzvos is that the item or action should be set aside exclusively for the mitzvah. By mitzvos, the kavanah must be had during the action of the mitzvah. By karbanos the kavanah lishmah is fulfilled initially when one sets aside an animal to be a karban. When one has no kavanah in mind during the shechitah, the karban remains set aside for the right purpose; therefore it is still kosher. However, when one has the wrong kavanah he uproots the lishmah that was set forth by setting it aside for a karban; therefore it is pasul.
In conclusion, the machlokes between the Brisker Rav and Reb Elchonon may in fact be a machlokes between the Rambam and Tosafos.