Tons of good answers already, but I can't help myself but try to my hand too.
In terms of passive defense mechanisms, regardless of 2d/3d, you basically have to think of how you (or rather your avian species) can:
- slow/fatigue the enemy
- funnel the enemy
- stop the enemy
These same things can happen far from the fortification, nearer the fortification, and even inside the fortification.
Below are a bunch of ideas (got carried away), but the point is really the above: Slow, funnel, stop.
As already mentioned, tunnelling or burrowing would be obvious solutions for an avian species (indeed many birds in our world burrow or tunnel). You're protected on most sides, and funnel an attacking force quite naturally.
One could also consider burrowing upwards. A cliff by the sea could easily have some caves worn by water. From there you might burrow upwards into the cave's ceiling, and (given time), you'd have an upside-down mine. It might be a pretty natural idea for an avian species, just like digging downwards is for us.
Natural obstacles
The trick, though, for any of those structures would probably be in generally slowing an advancing enemy when that enemy can fly. A human castle might be near a river - or even swampland - which is difficult to ford or cross. And it also make it easy to spot attackers.
It's harder to think of something that would do the same in an airspace. Giant trees or floating rocks might work if your world otherwise allows for such contrivances. But it would also hide attackers. Giant cobwebs would be neat, though. Or: Large panes of clear glass. Many a bird have fallen victim to that.
But there are some naturally occurring things that could hinder flight:
- A smoking/ash-spewing volcano is basically a vertical river that'd be hard/dangerous to "cross". (And it's a pretty dramatic visual, if nothing else)
- Hot springs or giant geysers producing a lot of steam might work too.
- Natural wind tunnels, and places with vicious currents, like those between tall buildings or near mountains.
- Really tall mountains. Low temperatures and thin air affect any living being. (See also: False sense of security. Hannibal crossed the Alps in winter, after all.)
- An area with near-constant precipitation and/or fog making flight difficult. Swimming birds have feathers that repel water, but other birds aren't so lucky, and can't fly if they get soaked.
- Conversely, an arid desert area might have a perpetual sandstorm - not something you'd want to fly through. Plains might have tornados and lightning storms.
None of these will stop an army, but it could wear it down, and make an ordered advance impossible.
Speaking of precipitation: The good ol' cave-hidden-behind-a-waterfall. The defenders could have a retractable "tunnel" (or just a big awning) that would part the waterfall from inside the cave. Once retracted, attackers would be flying into a moving wall consisting of a few tons of falling water. (Though if I were attacking, I'd think about diverting the water somewhere upriver, if possible. Doing so for something the size of Niagara Falls would be pretty difficult, though.)
Passive defenses
In terms of more purpose-made passive defenses, smoke is a good option if you've burrowed into the ground, because smoke rises. It could make the dive into a shaft even more difficult.
Any type of fire, with or without smoke, could also cause strong updrafts that might be considered "difficult terrain" for anyone flying.
A hole in the ground like that proposed by Danny Reagan could be ringed by fire at the top: Not only would you have to dive into a heavily defended shaft that you can't see clearly, you'd also have to pass through dense smoke and updrafts first, and avoid getting singed on the way in.
A really devious (and pretty Looney Toons'y) idea would be to camouflage the real entrance, and light a ring of fire somewhere else. Brave attackers would dive for the center... and faceplant (beakplant?) into solid rock.
A horizontal tunnel could be blocked with a literal trap, like you see under a sink: A place where the tunnel "bucks" up or down. A low part could be flooded with water. The defenders would also be locking themselves in, of course, but unlike a cave-in, it'd be reversible.
A really cruel idea: Heavier than air gasses. Perhaps your world has a natural spring of sulfur hexafluoride or something. Fill the trap with that, and make flight really difficult - maybe even asphyxiate attackers, drowning them in "air". Of course a similar thing could be used by the attackers if the fortification is lower than its entrance.
Defenders at the bottom of a shaft might try the opposite: Lighter than air gasses. Though you'd need a lot you could create pockets of "light air" where the attackers wings won't carry them.
Hydrogen balloons could work as floating mines. Poke one and it'd (somehow) ignite. The fireball, while maybe not deadly, could singe feathers and prevent flight.
Weaponry
As for actual weaponry, others have already mentioned that your defenders might want to use ranged weapons with large cones of fire (e.g. birdshot) or AA-weapons like flak cannons. It may not be necessary to kill if your defenders can simply make flight impossible. Slinging tar or pitch could also interfere with flight by gumming up plumage. It's like anti-personnel mines, if less visually horrific. Still, removing a creature's main means of transportation is a horrible thing, regardless of how you do it, but that's why it'd be effective.