Mishnah 6 in chapter 3 of Maseches Avodah Zarah deals with the case of someone whose house neighbors a house of avodah zarah - that is, the two share a common wall. We are speaking of a temple that has the status of avodah zarah in its own right: not only are the objects inside it worshipped, but the place and the structure themselves are venerated. Picture a large, empty hall serving as the temple of a particular avodah zarah, where worshippers come to connect with it - and the building and the location themselves are objects of worship as well.
"Mi shehayah beiso samuch la'avodah zarah venafal" - one whose house was adjacent to an avodah zarah and it fell:
A person whose house stands next to a house of avodah zarah and shares a wall with it, and that shared wall collapsed - "asur livnoso" - he may not rebuild it. By rebuilding he would be helping to restore the temple. At the very least this involves "lifnei iver," since he is assisting the worshippers of avodah zarah in their service; and beyond that, he derives direct benefit from the avodah zarah, since the wall itself is part of the temple of the avodah zarah.
It is worth emphasizing that the case the Mishnah is discussing is where the Jew came first: he built his house permissibly, and only afterward did the neighboring structure become a house of avodah zarah. Had the temple been there first, he would not have been allowed to build his house flush against it in the first place, since he benefits from the shared wall. Here, however, his building was permitted, and now the wall has fallen and he wishes to rebuild his house.
"Keitzad ya'aseh?" - what should he do?
The Mishnah answers: "Kones betoch shelo arba amos uvoneh" - he draws back four amos (about six feet) into his own property, and builds only there. The reason: if he were to build on the previous property line, the neighboring temple could be rebuilt with fewer materials, lean on the wall, or use it jointly - and all of these are forbidden, as explained. He must therefore move inward.
It should be noted that in many versions of the Mishnah and in the Rishonim this measure of four amos does not appear; it is enough that he move inward at all: once the wall stands on his own property by itself, with no neighboring structure touching it, there is no assistance to avodah zarah. But according to our version a full four amos are required, and consequently a sizable area is left empty.
What is to be done with that area? Since the temple, when it is rebuilt, is liable to expand into the boundary of his lot, the homeowner must protect his rights and enforce them, and not give up any part of his land. On the other hand, he may not build there. The solution is to fill the space with something useless that safeguards the property:
Planting thorn bushes in that area.
Making the place into a bathroom for the use of small children only - not for adults, since adults need walls that provide privacy, and building walls in that spot is precisely what is forbidden.
In this way the area is filled with thorns or waste and the like, the temple derives no benefit whatsoever from it, and they are given no opportunity to expand the base of their worship in any way.
"Hayah shelo veshel avodah zarah - nidon mechetzah al mechetzah" - if it was his and the avodah zarah's, it is judged half and half:
If the wall itself, or the ground beneath it, was shared space - for example, a wall two feet thick, one foot of which is his and one foot the temple's - then half the thickness of the wall counts to his credit. "Nidon kemechetzah al mechetzah": we regard the wall as half and half, and when he must move inward a given distance, that foot on which the wall previously stood is included in the calculation. The rule is that a person may count his own space in the reckoning, but not the space belonging to the temple of avodah zarah.
The status of the ruins:
With the ruins themselves there are two separate issues:
Prohibition of benefit: anything that served idolatry, even as a base for it or as an ornament, is forbidden to derive benefit from.
Rabbinic tumah: the Sages gave idolatry the status of something that conveys tumah, and this is the novel point the Mishnah presents here.
Since we are dealing with a temple in which the structure itself was worshipped, the stones themselves are forbidden to benefit from. Therefore, stones and building materials that a person can identify as his own he may keep and reuse; but whatever cannot be identified is a mixture of forbidden and permitted, and since the prohibition is one of benefit, the entire mixture becomes forbidden to benefit from, and nothing may be taken from it.
Nevertheless, he may sell his share in the ruins to the idolatrous temple across the way, since he is not benefiting from the idolatry but from what was his to begin with. For example: if the ruins as a whole are worth one hundred dinars, and half of them are his but he does not know which half, he cannot take the stones themselves, but he may say to them: give me fifty, and the ruins are yours.
How the tumah is transmitted:
The Mishnah teaches that the earth itself conveys tumah, and this law is separate from the prohibition of benefit and is rabbinic in origin. The question is by what parameters it conveys tumah: only through direct contact, or even through indirect contact, by carrying its weight, which is masa (carrying). Two prototypes stand here opposite one another:
A sheretz: one of the eight creeping creatures the Torah lists explicitly. When they die they convey tumah only through contact; one who carries a dead sheretz in his bag without touching it does not become tamei.
A niddah: she conveys tumah not only through direct contact, but even through the carrying of her weight. One who carries her weight becomes tamei.
Since the law is rabbinic, the Tannaim disagree as to which verse to use as an asmachta - not as a source that teaches the law, but as a hint on which the Sages hung their enactment.
According to the first Tanna, the law of idolatry is like the law of a sheretz: "avanav ve'etzav va'afaro metam'in kasheretz" - the stones, the beams and the earth of that wall convey tumah like a sheretz, that is, through direct contact. This does not mean that the minimum measure is the size of a lentil, as with a sheretz, but rather an olive's volume, the measure for the tumah of a corpse, for elsewhere Scripture relates to idolatry with the severity of a corpse. The comparison to a sheretz is only regarding the manner of transmission: through direct contact alone, and not like a corpse, which conveys tumah in other ways as well.
"shene'emar" - this is the asmachta from the verses. It says in Devarim (7:26): "shaketz teshaktzenu" - that the idol should be detestable and repulsive in your eyes. The word "sheketz" is close in meaning to "sheretz": sheratzim are all the repulsive crawling creatures, including those not counted among the eight creeping creatures (such as a tarantula), while the eight creeping creatures are a specific list within that category. Since the verse in Devarim compares the idol to a sheketz, we say that it is like a sheretz, which conveys tumah through contact.
Rabbi Akiva is more stringent and holds that the Sages' enactment regarding the tumah of idolatry applies not only to contact but even to carrying, like the law of a niddah. "shene'emar" - the verse in Yeshayah, which speaks of distancing idolatry and treating it as repulsive: "tizrem kemo davah, tzei tomar lo" - scatter them and distance them from you the way one distances a menstruant woman who sits apart, and say to the idolatry: get out of here. Since Scripture used the term "davah," we learn that the manner of tumah too is like that of a niddah: "mah niddah metam'ah bemasa, af avodah zarah metam'ah bemasa" - just as a niddah conveys tumah through carrying, so too idolatry conveys tumah through carrying.
The halachah follows the first Tanna and not Rabbi Akiva: idolatry conveys tumah only through direct contact.
A further point - the principle of bereirah:
According to the Sages, who hold that the stones of an idolatrous house are a source of tumah, one may well ask: regarding the prohibition of benefit, which is a Torah law, it is understandable that when the stones are mixed together none of them may be used, since there is no bereirah (retroactive clarification) in Torah law - one cannot designate after the fact and say that half the stones are mine and half belong to the idolatrous house, and that the half which is not mine is the forbidden one. For this reason only the identified stones may be used, and whatever cannot be identified must be treated as forbidden.
But since the law of tumah here is rabbinic, it would have been appropriate to permit bereirah in this case, and to say: take your half of the stones and do not treat them as tamei, while the other half will be considered tamei. From this we learn that the Sages were extremely stringent with the tumah of idolatry and did not allow bereirah to take effect. We therefore treat all the stones as tamei, even though this is only a rabbinic law, and the principle of bereirah is not applied here.