Food storage. Make giant room with a device that, once per round, casts purify food & drink on the next 1 foot cubic section of its many shelves. Per day, it's perfectly preserving 14400 cubic feet of food. That much food is enough to feed around 300 people for a year, maybe more like 600 if it's packed in tightly (*see below for calculations). A few rooms like that and sieges are much less of a problem, and far less food is going to be wasted due to going bad, and things will be available year round instead of only in certain seasons.
Also, it wouldn't be very expensive. Purify food & drink is a zeroth level spell. If (following the advice from the 3.0 stronghold guidebook, you construct the immobile device like a magical trap, it only costs 250 gp*. Constructing a few of those is easily within the wealth of a civic-minded mage.
(Water weighs ~60 pounds per cubic foot. Assume food weighs half of that, for 30 lbs/cu.ft., and that half the space is wasted on containers and empty space, for 15 lbs/cu.ft.. 14400*15=216000 lbs. Figure 2 lbs of normal food per person/per day (1 pound of iron rations really isn't enough for long-term survival) = 108000 person-days of food/365 days = food for 295 people for a year)
(500gp*1(caster level)*.5(spell level)=250gp cost, per the 'constructing magical traps' chart)