The Rambam writes that if the community collected funds to build a Beth Midrash or Synagogue, or to buy a Tebah or scarves and a case for a Sefer Torah, and then wished to use the funds for a different purpose to what they were collected for, whether or not they are permitted to do so depends on what they wish to use the money for.
If the item they wish to use the donations for is of a higher level of holiness, it is permitted. If not, it is prohibited. If, however, they used the funds for the purpose that they were collected for, but there was money left over, the additional money may be used for whatever they wish.
All the items of a Synagogue are considered to be like the Synagogue itself. The Parokheth (curtain in front of the Ark) is considered to be like the scarves used on the Sifrei Torah. If any condition was attached to the purchase, stipulating that the item could be used for a different purpose, the stipulation is valid.
(See Rambam, Mishneh Torah, Hilkhoth Tefillah 2, 11:15)
Rambam, Maimonides, Laws of Synagogue