As I said, United can set whatever policy it wishes, but none of that means the gate agent couldn't exercise some discretion. The intent of the rule is plainly to ensure non-revs are presentable and don't harm the image of United. I think you'd have a hard time finding anyone with the stick so far up there that they're bothered by a
child in leggings, or who would somehow think less of United for having an employee who allows their
child to wear them. Anyone that perturbed by other people couldn't possibly tolerate the broader experience of flying United (I spend a lot of time on their airplanes).
How far can United take it before some common-sense and discretion would be appropriate? Can a 2-y.o non-rev wear "items designated as sleepwear" when boarding a red-eye?