The issue is that the upgrade's purchase counts as experience for the structure before enabling any upgrade. Since the Gondor Barracks have such a low exp requirement (400 as per patch 1.06) for Rank 2, the structure levels up before being granted the bonus level from the goodfactionbuildings.ini file.
Changing the LevelCap from 3 to 2 for the Level2 upgrade will fix the issue.
Another thing I discovered is that not having a "technology" to research and having two consecutive upgrades on the same structure (units too, I suppose) messes with how the tooltip conditions are being handled. Long story short, you'll have to use LacksPrerequisiteLabel for the level 3 upgrade rather than the usual DescriptLabel.
If you're interested, I can post a detailed tutorial with some of the codes/tooltips I'm currently using. Fair warning, I'm using a gamedata.ini substitute and being rather thorough.