The gemara (Sukkah 9) derives from a pasuk, “ta’aseh lecha,” that a stolen sukkah is disqualified for mitzvah use. The Rishonim are troubled by the need for a derasha to teach us this din. We know that any stolen object, such as a stolen lulav, is disqualified for mitzvah use because of the principle of mitzvah haba’ah b’aveira. Why then do we need a special limud to disqualify a stolen sukkah?
Tosfos (Sukkah 9) answers that the principle of mitzvah haba’ah b’aveira should in theory apply to a stolen sukkah as well, but mitzvah haba’ah b’aveira is only a derabbanan disqualification. The gemara cites a pasuk to prove that a stolen sukkah is disqualified even on a d’oraysa level.
Other Rishonim answer that the principle of mitzvah haba’ah b’aveira does not apply in the case of sukkah because mitzvah haba’ah b’aveira only applies to mitzvos objects used for “ritzuy,” for supplication, like a korban, like a lulav (na’anu’im), etc.
The Ritva challenges this approach, as it seems to contradict a sugya in the Yerushalmi (Shabbos 13:3). The Yerushalmi distinguishes between stolen matzah, which is disqualified because of mitzvah haba’ah b’aveira, and matzah carried in a public domain on Shabbos, which is not disqualified. In the former case, “taman gufa aveira,” the matzah itself is tainted by the act of theft; it is stolen goods; in the latter case the act of carrying has no effect on the matzah itself. Be that as it may, matzah is not a “ritzuy” type mitzvah. Nonetheless, stolen matzah according to the Yerushalmi is disqualified because of mitzvah haba’ah b’aveira.
Is there a way to reconcile the view of these Rishonim with the Yerushalmi?