Chapter 2, Mishnah 2. This mishnah introduces the subject of me'ilah (misuse of sanctified property), which is an entire tractate in its own right in Seder Kodashim.
The law of me'ilah:
The halachah is that one who derives benefit from something belonging to hekdesh (property consecrated to the Temple) has committed me'ilah and transgressed the prohibition of misusing sanctified property. That is, by making improper use of hekdesh and deriving personal benefit from it, a person becomes obligated to bring a me'ilah offering, and also to pay the value of the benefit he derived plus a fifth as a penalty. That is me'ilah.
What is the benefit in giving the half shekel?
The question the mishnah raises is what the law is for someone who uses hekdesh money to pay his half shekel. The benefit he receives is not the benefit of the mitzvah itself, since we have a principle that "mitzvos were not given for the sake of benefit," and therefore one who uses hekdesh money to fulfill a mitzvah is not considered to have committed me'ilah. But the real benefit under discussion here is something else: by paying, he avoids the possibility that hekdesh, or the hekdesh collector, will seize his property as a pledge and security against non-payment. That is a genuine, tangible benefit.
The first case: the agent who gave the shekel on his own behalf:
A person gives his half shekel to his friend so that the friend will pay it on his behalf - "You are traveling to Jerusalem, take it along and pay it for me" - and the agent takes the half shekel and uses it to pay his own obligation. If he gave it after the terumas halishkah (the withdrawal from the chamber) described in the previous mishnah, in which the Temple treasurer enters the room where all the shekels are stored and takes out money to purchase offerings, then from that moment on the shekels became the property of hekdesh.
And since the terumas halishkah is taken on behalf of all the shekels, both those already given and those destined to be given, it turns out that the very half shekel he was supposed to give on behalf of his friend, and which he gave for himself, already belonged to hekdesh at the time he used it. He therefore used something belonging to hekdesh in order to avoid having his property seized as a pledge, and he benefited from hekdesh. Accordingly, the mishnah rules that he has transgressed the prohibition of me'ilah, and he must bring an offering and pay the principal plus a fifth.
The second case: one who takes from hekdesh money:
The mishnah continues with a very similar case, though somewhat simpler: nobody gave him anything, but he had access to certain funds belonging to hekdesh, and he took from them and paid with them on his own behalf. His benefit, as explained, is that no pledge will be taken from him for his outstanding obligation to hekdesh. Here too, if the terumah was taken and an animal was purchased from it - "ma'al" - he has indeed transgressed the prohibition of me'ilah.
Why is the purchase of the animal required?
When the mishnah makes me'ilah dependent on an animal having been purchased from those funds, it means that before the animal was purchased he had not yet become liable for me'ilah, since all he did was take from hekdesh and give to another form of hekdesh. And the halachah is that one who transfers something from one form of hekdesh to another form of hekdesh does not become liable for me'ilah unless some action was taken with the second form of hekdesh. It is not enough to move it from one pocket to another; actual use is required - that an animal was purchased with it, and then he is indeed liable for me'ilah. Some hold that even in the first case the mishnah is speaking of a situation after the animal was actually purchased, while others understand that in the first case no purchase of an animal is needed for liability for me'ilah.
A shekel paid from ma'aser sheni or shevi'is money:
The mishnah continues: one who pays his half shekel from funds that carry the sanctity of ma'aser sheni (second tithe) or the sanctity of shevi'is (the Sabbatical year) takes on an additional obligation:
Ma'aser sheni money: he must eat food in Jerusalem.
Shevi'is money: he must eat food with the sanctity of shevi'is, following the accompanying laws that apply to eating produce of the Sabbatical year.
This eating is, in a certain sense, a kind of redemption: a way of redeeming the value of the ma'aser sheni or the value of the shevi'is that rested on the funds he used for his half shekel.
How the redemption is done:
A person takes another coin and declares that those ma'aser sheni or shevi'is funds, wherever they may now be, after he gave them to hekdesh, should be redeemed onto this coin. He then uses that coin to buy food, which is eaten with the sanctity of ma'aser sheni or the sanctity of shevi'is.