THE ISUR TO LEAVE FOOD UNDER A BED
Under a Chacham's bed, only his shoes are found. Under an ignoramus' bed, a whole storehouse is found.
Pesachim 112a (Beraisa): If one puts food or drink under a bed, even if it is covered in an iron container, Ru'ach Ra'ah dwells on it.
Rif and Rosh (Avodah Zarah 10b and Sof 2:13): The Yerushalmi says that we must be concerned for everything that people are concerned for... one may not put a cooked food under a bed.
Ran (DH Pisa): One may not put a cooked food under a bed, for Ru'ach Ra'ah dwells on food under a bed.
Rambam (Hilchos Rotze'ach 12:5): One may not put a cooked food under a bed, even if he is engaged in a meal, lest something damaging fall in, and he will not see it.
Ra'avad: The Yerushalmi forbids due to Ru'ach Ra'ah.
Migdal Oz: I received that the Ra'avad's Perush is correct. According to the Rambam, it should be forbidden also under a table or chair!
Semak (171): Ru'ach Ra'ah is not common where people are found, therefore, we are not concerned if one is engaged in a meal. Perhaps Pesachim 112a discusses other times, when people are not around.
R. Yerucham (15:5 (141a)): One may not put a cooked food under a bed, lest something damaging fall in, and he will not see it. The Yerushalmi says so. If one transgresses this and says 'I will endager myself', he is lashed mid'Rabanan for transgressing Chachamim's words.
Shulchan Aruch (YD 116:5): One may not put a cooked food or drink under a bed, for Ru'ach Ra'ah dwells on it.
Beis Yosef (DH v'Tzarich): Even though the Rambam did not explain that a cooked food under a bed is due to Ru'ach Ra'ah, one must be concerned for this, like the Ran says. Ru'ach Ra'ah dwells on a drink under a bed, even if it is in an iron Keli.
Prishah (26) and Drishah (7): The Rambam forbids due to exposure; people used to sit on beds while eating. This is why some are lenient nowadays. The Beis Yosef connotes that the Ran argues. I disagree. The Ran discusses a bed that people sleep on. The Rambam discusses a bed on which people eat. There is no Ru'ach Ra'ah underneath it. Since nowadays we do not eat on beds, the Tur and Ran, who bring only what applies nowadays, always forbid under a bed.
Rebuttal (Shiyurei Berachah (Birkei Yosef) 9): Pri Chodosh says that if the food is covered, the Rambam permits. This is wrong. It was taught Stam that it is forbidden, due to Ru'ach Ra'ah, even if it is covered! Perhaps The Rambam omits all matters of Ru'ach Ra'ah. The Rambam and Ran argue about whether the Yerushalmi is concerned for things falling in, or for Ru'ach Ra'ah. If so, the Ran has no source for the Rambam's law, and vice-versa. The Rambam learned from the Yerushalmi, which says that one must be concerned for everything that people (on their own) are concerned for. People are concerned for things falling in, but not for Ru'ach Ra'ah! For all the matters the Yerushalmi lists, the concern is from the matter itself, not from something else. However, it is difficult why the Rambam omits the Bavli.
Toras Chayim (Bava Basra 58a, cited in Gilyon ha'Shas): Sleep is a taste of death, and there is no Neshamah to ward off Mazikim. Therefore, under the bed is like under a Mes at the time.)
Binas Adam (63, on Chachmas Adam 68): The Gemara connotes that we are concerned even for raw foods. Omce, a radish was put under a bed, and the Gra commanded to dice it and throw the pieces in a place where no one will find them. Nowadays, many villagers put turnips and eggs under a bed. Perhaps since many transgress this, "Shomer Pesa'im Hash-m" (Hash-m guards people who do not know to guard themselves) applies. Alternatively, perhaps the (correct) text in Pesachim does not mention food at all, for the Rambam, Semag, Rif, Rosh and Ra'avad all cite this from the Yerushalmi. The Rambam and Semag say that the concern is things falling in, and the Ra'avad says on his own that it is due to Ru'ach Ra'ah. Perhaps the entire Beraisa was not in their texts, for they do not mention liquids. If so, only cooked foods are forbidden. The Gra was concerned for our text.
Pischei Teshuvah (5): Bava Basra 58a supports that the Isur applies to all foods. Under a Chacham's bed, only his shoes are found.
Tzitz Eliezer (19:56): Indeed, the Rashbam explains this due to concern for food under a bed, but Rashi (Sukah 21b) says that it is so the Chacham's household will not regularly come to his bed!
Kaf ha'Chayim (43): Some forbid only a bed fixed for sleeping. Some forbid only if it is used for relations. Toras Chayim would forbid only at the time one sleeps there. Ohr Yitzchak shows that one should be careful at all times if it is regularly used for sleeping.
Kaf ha'Chayim (40 and Aruch ha'Shulchan 11): The Shulchan Aruch connotes that a raw food is permitted, i.e. if it is not edible until it will be cooked or pickled. Some are concerned even for this. Nowadays we are not careful about this, and "Shomer Pesa'im Hash-m", for many transgress it.
Igros Moshe (YD 3:20 DH v'Hinei): The Shulchan Aruch mentions only a cooked food and drinks, for it brings other matters forbidden due to danger from the Yerushalmi. Perhaps the Shulchan Aruch forbids only cooked food, and therefore, it needed to forbid also drinks, even though the Yerushalmi omits drinks. However, why should we rule like the Yerushalmi against the Bavli?! Therefore, it is more reasonable to say that the Shulchan Aruch forbids all foods.
Minchas Yitzchak (4:117): Some equate the Isur of food under a bed to touching food after sleeping at night without washing, and therefore, it does not apply to a Nochri's bed. Mishbetzos Zahav (4:4) is concerned for even young (Yisrael) children. Shulchan Aruch ha'Rav says that this Tum'ah seeks only a Kodesh 'Keli' from which the Kedushah (Neshamah) left (during sleep). Therefore, we are lenient about children below the age of Chinuch. The primary Kedushah comes at Bar Mitzvah. Sidur Ya'avetz brings many opinions about this. Those who are lenient can also be lenient about food under a carriage in which a baby sleeps. Even though some do not equate these matters, this is a reason to be lenient. The primary Heter is based on Mizmor l'David (brought in Darchei Taharah 116:37). He permits putting a cooked food between pillows and blankets to keep it warm, for the Isur is only on the ground under a bed. Also, Darchei Taharah (38) cites Mili d'Chasidusa, who is concerned only for a bed on which people have relations. Therefore, one may be lenient l'Chatchilah about a carriage.
Kaf ha'Chayim (42): Yafeh l'Lev (YD 3:116:6) says that the Isur is only on a dirt floor. Ru'ach Ra'ah does not dwell on a tiled or wooden floor, like we say about Mayim Acharonim. Some disagree, but one may combine this with other reasons to be lenient.
Tzitz Eliezer (10:35): Seemingly, the Isur should apply under a bed in a boat, even though one has no other place to put things. Some are lenient about raw foods, or b'Di'eved, or for a bed not used for relations. However, perhaps all permit in a boat. Darchei Taharah, citing Yafeh l'Lev, forbids only on a dirt floor. Normally we are stringent for a tiled floor, but this custom does not prove that we must be stringent on a boat. There, the floor is not even attached to the ground, so we cannot apply 'whatever is attached to the ground is like the ground.' We find that Kishuf (magic) does not apply to water (Sanhedrin 67b). Darchei Taharah says that nowadays the concern is Kishuf. An additional Heter is from Keren l'David (OC 1), who is lenient if the bed is its own Reshus, i.e. 10 Tefachim tall, and perhaps even if it is three Tefachim, for then it is not considered attached to the ground through Lavud.
Shemiras ha'Guf veha' Nefesh (14(1)): R. Yeshayah Epstein permits l'Chatchilah to put food under a bed on Pesach night, for it is Leil Shimurim (guarded from all damagers).