What's the advantage in upgrading your expansion into a lair instead of the main?
Solution 1:
Simple answer: more health for the opponent to work through when it gets attacked.
Longer answer: see above. :) That's really the only reason the expansion gets upgraded first. But it also is a little map dependent too. If they can only reach your base early in the game via the front (i.e. Xel'naga Caverns) you'd want it to have more health so that you can hold onto it a little easier (i.e. buy you more time for your army to get there to defend it). But if they can walk into your main from another route, then there really is no advantage and just a matter of where your army is.
Solution 2:
I would add to Sorean's answer. This is also something to factor in for maps like the older version of Shakuras Plateau where there were destructible rocks into the back of your main, and a path connecting. When you had horizontal spawns, depending on some race matchups, it was likely the opponent would attack through that passage, and would take out your main with a big push. By making the lair at your natural, you don't lose that tech when your main is taken out, especially if you are in a late game macro situation where you are on 4+ bases.
Solution 3:
Often the reason of that is that 'main' is building queen. In order to start lair upgrade you need to either cancel queen or just upgrade another lair.