I think it is a good idea not to let dragons attack ground-based foes because then people could just become a dragon every single battle
Yes, if you became a dragon in every fight, with the game as it is, and battled the existing foes that are currently game-balanced to be fought on foot, then yes, you'd kick ass in a big way, and the game would become easy.
But that's rather like saying "if you could become a dragon, and then not be hurt by the pedestrians, you cold just become a dragon and fly past every fight!"
If a game gives you an ability, then yes, you can use that ability, and the game must be balanced to take it into account.
Fortunately, there are any number of game-balancing solutions to both those problems, including:
* Forcing them to be faced on foot by preventing dragon form: foes in confined spaces like tunnels/caves or even ledges with fences; magic charms preventing polymorphing; force fields. These were used in the game already, to force you to face them.
* Rewarding the player with more XP per kill on foot: currently, if you fly past a fight, you get 0 XP, so it pays to fight on foot, rather than fly.
* Adding in flying foes and gun emplacements that ignore pedestrians, so dragons end up fighting more foes: these already exist.
* Making the pedestrian foes better at harming dragons: give everyone a bow, sling, or spells that they can use if they can't reach you. This is already needed because the AI can often not reach you if you stand on a rock, and allows itself to be mown down.
* Defending the pedestrian foes better against dragons: give them fire defence spells, grapples, and nets.
* Increasing the number of pedestrian foes: which would also be more fun, mowing down crowds as a dragon;
* Permitting more sneaking ability, and ability to talk your way out of fights, when on foot, to allow two approaches: subtlety on foot, or all-guns-blazing full frontal attack with the dragon.
* And tons more that I didn't think of, I'm sure.
I imagine that Larian, had they been able, would have done some combination of these. It is a great shame for the game that they could not, but it does mean there is still a lot of scope for the theme to be developed in future games.