The cheapest, permanent, non-dispel-able wall is as follows:
Impermeable to creatures. Impermeable to vision and light (opaque). Not affected by disintegrate. Area may be crudely shaped by reducing area. Wall must be bonded to surrounding material. Wall must be solidly supported. Wall must always be a flat, vertical plane. Wall must always be in contact with ground. 0'. Indefinite (until dispelled/destroyed). 500 square feet. 10' thick. May not be evoked where objects/creatures are. No saving throw permitted. Arcane. Total: 42.42, Spell Level 5
That is a 50' tall, 10' thick, 10' long wall that can't be used as floor or ceiling, and can only be crudely shaped. Ceilings, floors, crenellations, even windows require a different spell (same, except 1' thick, readily shape-able, and not to be a vertical plane). Anything fancier, and it's going to be a 6th level spell or more. If you were to hire a mage to cast the spell(s), it would cost 1,250gp per cast; a 100' long wall, therefore, would cost 12,500gp. The equivalent (non-disintegration-proof) mundane wall would be 17,500gp. So, you see a savings of quite a bit of time (10 days instead of 35), and 5,000gp. It's not such a bad deal, as long as you're building flat, square, magically fortified walls, and have access to a Class IV market or better. However, I personally would rule that such a wall is smooth and strange; impossible to build on top of, since there's no way to dig into it, and obviously magical. Anything connected to the wall must be magical, since this material is nigh-on indestructible, or else the non-magical part (say, a gate) must exist before the wall is added. While the wall itself will save you money, a 10gp arrow slit is going to cost 1,250gp; a 200gp, 500 square foot floor is going to cost 1,250gp. A basic flight of stairs is going to cost 3,750gp (three 1'-wide casts) instead of 60gp!
Moving parts like doors, shutters, etc. are impossible, which means any egress points will have to be in place before hand, and made of mundane materials, which are much, much weaker than the surrounding structure. Otherwise, the pieces will have to be built in advance, hoisted into place, and attached. Repairing such a point will be very expensive. And of course, you'll still have to pay for an engineer to design the layout and instruct the caster(s) on where to place the walls. Stronghold upkeep should still apply, using the cost of the spells as the base cost.
That said, magical walls make sense, as long as it's a basic, featureless wall, but anything more than that is going to be hugely expensive. Worse, planning will have to be perfect; there is no way to demolish part of a wall and expand. You have to either build in "connection" pieces that aren't permanent, and are thus weaker, or just abandon your old buildings entirely. Still, all in all, it sounds like magical constructions are cheaper and faster than normal construction, and much more durable...
Except they aren't!
A Rod of Cancelation costs far less than the army required to storm a mundane castle. Permanent and non-dispel-able they may be, but the walls are still magical. With a touch, the wall, the castle, the floors and ceilings and steps and everything else turn into a mundane version - and, in this case, since the walls are purely magical, the mundane version is "nothing at all".