Communal Responsibility
From Halachipedia
Halacha places high importance on a community's responsibility to one another. A community is halachically obligated to fund communal needs. These needs include security needs; a community is required to build a wall and gates. These needs also include religous needs; a community is required to build a synagogue and ensure that is well stocked with a sefer Torah and seforim.