The second Mishnah in the thirteenth chapter. Even though the topic of the remaining chapters is slaughtering and offering outside the Temple, we digress for a moment from the subject: The previous Mishnah dealt with a dispute between the Sages and Rabbi Yosi HaGelili, and since the conceptual structure of that dispute is very similar to another dispute between them, the Mishnah brings it here as well. The topic before us: the restrictions on eating Kodashim in a state of tumah.
Two Separate Torah Prohibitions:
A tamei person who ate Kodashim - A severe prohibition whose punishment is kares. And if he did this inadvertently, without knowledge and without intent to transgress, this is one of the cases where he brings an oleh veyored sacrifice - a variable sin-offering according to his means: If he can afford it, he brings a female goat or sheep; if he cannot afford it, he brings two birds - young doves or turtledoves - one for a burnt-offering and one for a sin-offering; and if he cannot even afford this, he brings fine flour and offers it as a sinner's meal-offering.
Kodashim that became tamei - It is forbidden to eat them even if the person himself is tahor. This prohibition is also from the Torah, but it is only a standard negative prohibition, which does not carry kares.
The source of this distinction lies in the wording of the verses: The verse dealing with a person who eats from the flesh of a peace-offering to Hashem while his tumah is upon him - a tumah that he had the power to partially remove, such as by immersing in a mikvah, but he did not remove it - establishes that this person is liable to kares and is cut off from his people. From here we see that kares is stated specifically when the person himself is tamei. But when it is the food that became tamei - through contact with a tamei object - there is only a standard negative prohibition here: it does not carry kares, and if there were two witnesses there who saw and warned him, "Do not do this," and he did it anyway, he is liable to lashes.
The Wording of the Mishnah:
Against this background, let us examine the Mishnah, which parallels the previous Mishnah to some extent: A tamei person who ate Kodashim - whether those Kodashim were already tamei or whether they were previously tahor - "chayav" - he is liable, liable to kares, and if inadvertent is liable to an oleh veyored sacrifice. Rabbi Yosi HaGelili disagrees: "Tamei she'achal tahor, chayav" - a tamei person who ate tahor Kodashim is liable to kares; but "tamei she'achal tamei, patur" - if he ate Kodashim that became tamei before he himself became tamei, he is exempt, "shelo achal ela davar tamei" - as he only ate a tamei item.
To this, the Sages reply to him, roughly parallel to what we saw in the previous Mishnah: "Af tamei she'achal tahor, keivan shenaga bo - tamei hu" - even a tamei person who ate something tahor, since he touched it, it is tamei. From the moment the tamei person touches the tahor Kodashim, they also become tamei, and ultimately he ate a tamei item. Therefore, say the Sages, he is liable to kares whether the Kodashim were tamei before he came into contact with them or whether they only became tamei afterward - there is no difference.
The Root of the Dispute:
The dispute between the Sages and Rabbi Yosi HaGelili, as presented in the dialogue in the Mishnah, is based on a misunderstanding of Rabbi Yosi HaGelili's position. The Sages assumed that in his opinion, the reason for the liability of kares is that the one eating profanes the Kodashim and nullifies their sanctity, and therefore if their sanctity has already been nullified and they are already tamei, there is no longer any room for a prohibition carrying kares.
"Ein Isur Chal Al Isur":
However, this was not his position at all. The issue at hand here is the principle called "ein isur chal al isur" - a prohibition cannot take effect upon an existing prohibition: something that is already forbidden cannot be forbidden again by a second prohibition. This is the position of Rabbi Yosi HaGelili, and according to it: The Kodashim became tamei first, and from that moment they were forbidden to be eaten by the person - even when he was tahor. And since they were already forbidden to him, even when he himself became tamei, nothing new was added; the first prohibition is all that exists here, and its prohibition is only one of lashes, because the food is tamei. There is no second prohibition here that would make him liable to kares on account of his being a tamei person eating Kodashim.
The Sages' Position - "Isur Kolel":
The Sages agree with the principle that one prohibition does not take effect upon another, but in their view, this rule is limited by a concept called an "inclusive prohibition": when the second prohibition is broader and more encompassing than the first, introducing new elements, it has the power to add a second layer of prohibition onto the item that was already forbidden. In our case: the piece of Kodashim that became tameh was forbidden to the person even when he was tahor; but once the person himself becomes tameh, all Kodashim become forbidden to him. Since this prohibition is more inclusive and encompassing, it takes effect even on those Kodashim that already became tameh - not just on the tahor ones - and creates a second layer of prohibition upon them.
Although the dialogue in the Mishnah does not explicitly reflect this, it is clear from the context that this is the point of dispute: Rabbi Yose HaGelili treats the rule that "one prohibition does not take effect upon another" as absolute, and does not accept that an inclusive prohibition adds a second layer; whereas the Sages disagree and hold that an inclusive prohibition does indeed add a second layer of prohibition.
Halachah: The halachah follows the Sages. A tameh person who ate Kodashim - whether the Kodashim were tameh or tahor before he himself became tameh, there is no difference: if he did so intentionally, he is liable to kares, and if unintentionally, he brings a korban oleh veyored (a sliding-scale offering).
To conclude, the Mishnah brings another example, a case where everyone agrees that there is no liability for kares: "Vetahor she'achal tameh, patur" - if the eater was himself tahor and the Kodashim he ate were tameh, he is exempt from kares. This does not mean he did not violate a prohibition: there is a negative commandment here, and he may even be liable to lashes if he received a warning, but there is no element of kares here. The reason for this is, "she'eino chayav ela al tumas haguf" - the liability for kares depends on the person's body being tameh, and not on the food being tameh. Here, the person himself was not tameh, and therefore he is not liable to kares.