סוכה כב:
"מעמיד דמעמיד בדבר המקבל טומאה"
R’ Yehuda says one may not stand up his bed & use it for a succah wall & place the סכך directly on it. The רבנן say it is מותר. There is a מחלוקת in how to understand why ר' יהודה says this is אסור. One way is that a bed is a movable object, so this succah isn’t קבע; another explanation is that a bed is מקבל טומאה& one may not put סכך directly on something that is מקבל טומאה.
The ר"ן brings the רי"ף that says the halacha is like ר' יהודה because it is מעמיד on a דבר המקבל טומאה & this is אסור from a גזירה - we are afraid that he might come to use this דבר המקבל טומאה for סכך which isפסול . The ר"ן goes on to say that don’t be surprised that we allow one to put סכך across stone walls even though they are אינו גידולו מן הארץ & are פסול to use as סכך. There, we are not גוזר because since it is not the norm to use stones for סכך we do not apply the גזירה to stone walls. The [תר"ל, סי' יג'] שו"ע paskens that if one was מסכך directly on כרעי המטה, theסוכה is כשר. The משנ"ב [נט] explains that even though the walls of the bed are מקבל טומאה, the מחבר is not concerned with placing סכך directly on them. The חפץ חיים in [ס'] שער הציון, brings the בית יוסף in the name of the תרומת הדשן, that learns the רי"ף not like the ר"ן but that the פשט in ר' יהודה is like the first reason, that the bed isn’t קבע but supporting סכך on something that is מקבל טומאה is not an issue. He also brings the רא"ש who also learns like this. The ח"ח says that based on this he would not be מיקל to allow placing סכך on מקבלי טומאה, because the ר"ן & the ריטב"א learn differently in the above רי"ף, that the issue is with placing סכך directly on מקבלי טומאה. He continues & says that after a lot of עיון he found many פוסקים that say the halacha is like the חכמים & not like ר' יהודה, which means we aren’t concerned at all with סכך being supported by מקבלי טומאה. Even the above ר"ן that learned we are concerned, learns it’s only a גזירה דרבנן. He concludes that one can certainly be סומך on these מקילין, but לכתחילה it is good to be נזהר בזה to be יוצא לכל הדעות.
The [תרכט,סי' ח'] שו"ע paskens that one may use nails to keep together the walls of a succah. The משנ"ב explains that even those that do not allow סכך to be on a מקבל טומאה, here the nails are attaching the walls & the סכך is not on them so it’s only a מעמיד דמעמיד & everyone will hold this is מותר. On this halacha of מעמיד דמעמיד, the חזון איש argues & holds that even though these nails are once removed from the סכך it still has the same דין as מעמיד & it is אסור.