Some magic is about sacrifice. A castle can have a garrison and sit in the middle of a friendly (or at least ethnically loyal) population and change hands regularly. A wizard's tower can stand alone for centuries. Because every now and again, some idiot gets an army together and tries to take one. Their legends discourage future attempts.
This is more of an item ability than a spell. A wizard with the correct property rights may once (not once a day, once a month or once a millenium, but exactly *once*) activate a magical structure to defend hearth and home. This takes a bit of time (one full turn, ritual casting, or however your game covers "about as long as it takes to brew a cuppa without a fire going"). The wizard must have legal title to the place, either inherited, elected, or constructed. The structure fights as an enormous golem, running along on its pillars, columns, or flying buttresses and steamrollering anyone that doesn't get out of the way. It moves either the length of its footprint or its height, whichever is greater, in a straight line every round. Everything that doesn't get out of the way is essentially getting hit by a rockslide. The building is still a building - its ability to take damage is neither lessened or increased. The structure will fight for one round for every year that the wizard has lived in it, plus a round for every five years that previous owners in the line of succession have not used the ability. At the end of this time the structure must make a Saving Throw - success means it still stands, if it is able to on the location it ends the duration in. Failure means it collapses in a pile of masonry, its wizard pilot usually escaping the collapse by one sorcerous stratagem or another. The duration on this ability means that it is normally only used in defensive circumstances. But there was this one resurrected Pharaoh...