Wars in the 20th+ century have also shown that if you actually want to conquer a country, you have to send in ground troops after weakening them with planes/fliers. And that buildings are, surprise surprise, easier to defend than empty ground. If you combine that with the fact that it is immensely easier to build buildings and walls than dig great caves (excepting if you are a mid-high level spellcaster or one owes you several days of labor), I think you would still see more traditional defenses. Most of the labor available is commoner/expert, after all.
Basically yeah. The better your ground defenses are, the more costly it is to penetrate, and thus dissuade your opponents.
Underground or bunker style settlements are extremely inconvenient for anything that isn't combat, especially if you don't make use of a lot of magic. They are also vulnerable to quakes, much more so than surface structures, and are isolated from the resources most humanoid races want(fresh water, fresh air, vegetables, meat). They're low on room. They also make it unnecessary for opponents to field air forces and limit your ability to field your own. They're finally, bad business for small humanoid/goblinoid invasions, as they can pack more units into a given space and swarm your bunker.
Theres probably a role for magically supplied 'core' bunkers but they'd only be for rulers and other vital personnel to retreat to.
Walls increase the costs, any ground based attack has to go over or under, which can be countered(air force, summoners on call, archers) or negated(deep wall foundations, real walls had to deal with sappers too, though they probably didn't have to deal with bulettes). Air attacks that can bypass cheap countermeasures are low accuracy(dropping rocks and bombs while you have a -50 penalty to spot against a structure with a +20 bonus to being spotted), and far more easily replicated with siege engines, which does not risk being countered by a local air force and can pack much more of a load.
They're also relatively cheap to construct, even unskilled labor can provide a man high wall of packed dirt and logs, and skilled labor(especially if you have big, strong races like ogres or minotaurs resident) dramatically increases the height and quality of walls.
Walls didn't go out of style because of aircraft, they just weren't cost efficient because nobody uses melee based invasions anymore and they're kinda inconvenient to urban sprawl.
Moats meanwhile, add a bigger complication, any invaders would need to bridge them, which means additional load when they approach. A 'fresh' moat fed by rivers has an added bonus, sappers and diggers in general risk drowning if they hit the wrong area.
Towers round it out. If you have fliers and mages, you most definitely want towers for vantage points and launching posts. No sense wasting time gaining height, and they're also easy to defend from any direction.
On the attack side, if you use fliers, they would not be making high runs against the walls, you have better tools for that. The better option would be a low flying scouting run(go high over the walls, and then dive and pull out before they assemble to kill your ass), or precision strikes(which are also low flying due to the distance penalties) to destroy key structures.