Could the minhag (=custom) of lighting menorah in synagogues have developed from when guests would stay in the synagogue? Does anyone bring this as a source for the minhag? If so, would it not apply nowadays?
There's an article on this by Dose of Halacha. Here's an excerpt:
While the Rema (OC 671:7) follows the Rivash that one can’t fulfil one’s obligation to light through the shul’s menora, the Kolbo (44) writes that one reason for this minhag is on behalf of those who don’t light at home. The Beis Yosef (OC 671:7) writes similarly that visitors can fulfil their obligation through the shul’s Menora. The Shibolei Haleket (185) writes that as visitors no longer sleep over in the shul¸ this reason no longer applies.