For many generations, perhaps millennia, houses of worship were supposed to be immune from attacks.
The fact that they are now endangered is a very sorry reflection on the state of our society.
When such a threat is not a paranoid response but has some rational basis, it is an issue that needs to be seriously discussed with a community’s leaders, security personnel and educators.
As for the question itself, traditionally, places of worship are not the right place to carry weapons.
In some faiths, this is very emphatically stated.
However, this is surely not a universal tenet of belief: in many faiths, religious leaders were also military leaders, and did not find any conflict between those two functions.
Even in Christianity, there have been several Orders composed of soldier-monks: the Templars and the Hospitaliers, among them.
If we live in times when a person in the house of prayer is prone to be killed, the right to be defended grows from deep roots.
Rabbi Adin Steinsaltz
Quoted in the Washington Post