After reading this question on how to safeguard an inanimate item, and thinking back on this question of mine, which was closed as too broad, I still think a list of spells that allow creating a very defensible location would be beneficial - I've checked back on that question of mine more than once, but I'm not sure it's 100% complete.
Anyways, to limit the scope of this question, here are my criteria:
- the spell is either permanent by default (such as Hallow) or can be made permanent by casting it repeatedly in the same spot (such as Forbiddance)
- the spell has either
- a detrimental effect on all creatures, specific creatures or specific creature types or ...
- a beneficial effect on specific (not all!) creatures or creature types
- the spell does not create or is related to minions (such as Finger of Death for undead guardians, Simulacrum, or Geas'd hirelings.
- terrain shaping spells are not within the scope of this question either, even if they can be creatively used to defend a location.
- this question is limited to spells. Magical objects or mundane traps, useful as they might be, are therefore not within the scope of this question, either.
Since this should result in a very limited list of spells (no more than I dozen, I'd wager) which is comparatively easy to maintain as new rulebooks come out, I don't believe this question should be considered off-topic, as per this meta.