The rule is something like "if you are working on the car in the pitlane, you need to have protecting clothing". Its likely a sort of blanket rule, if you are part of the team and on the pitlane, you need to have protection on.
In F1, you'll notice that during practice and qualifying they do have shorts, but they are allowed to have shorts if they are going to wheel the car into the garage. But during the race with the pitstops and such, they have full gear on.
In F2, since they don't have garages to use, they have to wear pants all the time, because they are on the pitlane all the time.
I probably explained it quite badly there. Anyway, something like that.