This Gemara raises several questions that are relevant in practice.
(a) The Gemara leaves the question -- whether one may sell an old Sefer Torah
in order to buy a new one -- unanswered. What is the Halachah in practice?
(b) May a Sefer Torah be sold for any other Mitzvah, such as Pidyon Shevuyim?
May a Sefer Torah be sold in order to provide the poor with sustenance?
(c) May a Sefer Torah owned by an individual (as opposed to one of communal
ownership) be sold?
(d) Is it permissible to sell a Sefer Torah when it was bought on condition
to sell it (such as by a merchant)?
(e) If a Sefer Torah was found to be Pasul, may it be sold in order to help
raise money to buy a new Sefer Torah?
(a) It is clear from the Gemara that if the new Sefer Torah is not yet ready,
it is certainly Asur to sell an old one, because something might happen which
will prevent the new one from being bought and the community will be left
without a Sefer Torah. The Gemara's doubt is when the new Sefer Torah is
ready to be bought.
The SHACH (YD 270:3) rules that it is prohibited to sell an old Sefer Torah
to buy a new one, even when the new one is ready. His reasoning is that we
must be stringent since the Gemara left this question unanswered (this is
based on the RAN and the ROSH and their understanding of the RIF). RAV MOSHE
FEINSTEIN (IGROS MOSHE YD 3:113) points out that even though the Isur of
selling a Sefer Torah is only mid'Rabanan, nevertheless we must be stringent
because of the Kavod of the Torah.
However, the LEVUSH and the TAZ permit selling an old Sefer Torah when there
is no concern that we will be left without a Sefer Torah. In practice, Rav
Moshe Feinstein (loc. cit.) rules that we should be stringent like the Shach
(see also Derishah, end of YD 270:2).
(b) TOSFOS in Bava Basra (8b, DH Pidyon Shevuyim, cited by the GILYON HA'SHAS
here) says that it is certainly permitted to sell a Sefer Torah for Pidyon
Shevuyim. Tosfos says that the Gemara did not mention it because it is so
obvious. This is the ruling of the MAGEN AVRAHAM (OC 153:9). (The DERISHAH
(YD 252:2), though, asserts that when Tosfos says that it is obviously
permissible to sell a Sefer Torah for Pidyon Shevuyim, Tosfos is only
referring to raising money for the Pidyon of oneself, but not for others.)
The MISHNAH BERURAH (153:24) points out that the Magen Avraham later (153:11)
rules that it may be sold for Pidyon Shevuyim only as a last resort, when
there is no other way to raise the money needed. This is the ruling of the
RAMBAM and SMAG.
According to the RAMBAM (Hilchos Sefer Torah 10:2), a Sefer Torah may not be
sold even to provide food for poor people who have nothing to eat. The
HAGAHOS MAIMONI questions the Rambam's source for this, since the Yerushalmi
(end of Bikurim) says explicitly that a Sefer Torah may be sold to provide
food for one who has nothing to eat. Moreover, our Gemara quotes Raban Shimon
ben Gamliel who said that if one sells a Sefer Torah in order to provide food
even if he has nothing else to eat, he will see no Berachah from the sale.
This implies that it is not *prohibited* to sell a Sefer Torah to provide
food; he will just not see a Berachah from the sale.
The BEIS YOSEF, though, says that the Rambam assumed that since the Gemara
says that one sees no Berachah from such a sale, it must be that the sale is
prohibited. However, the Beis Yosef seems to conclude like the Hagahos
Maimoni, that it is permissible to sell a Sefer Torah if one has no other
source to provide food for himself.
(c) The SHULCHAN ARUCH (OC 153:10) brings two opinions whether or not a Sefer
Torah owned by an individual may be sold. The MAGEN AVRAHAM writes that the
practice is to sell a privately-owned Sefer Torah, even if it was used for
public reading, since it is assumed that the owner gave it over for public
use only on condition that he retains the rights to sell it. The owner was
not *Makdish* his Sefer Torah to the public use, but rather he merely gave
them permission to read from it (SHA'AR HA'TZIYON 153:57)
(d) It is permissible to sell a Sefer Torah when it was bought on specific
condition to sell. This Heter also applies when one received a Sefer Torah as
payment for a debt owed to him (MISHNAH BERURAH 153:62). In both cases, he
may use the money for any purpose.
(e) RAV MOSHE FEINSTEIN (loc. cit.) rules that it is permissible to sell
Sifrei Torah that are Pasul in order to raise money to buy a new Sefer Torah.