Ultimately it's a self-interest thing...we are in a constant battle to preserve/enhance our compensation and marketing our image is a signficant aspect of that. For the average public moron perception IS the reality: when airline pilots walk around hunched over with a back-pack and ipod looking like a college sophmore the public's impression is that their services are worth what a college sophmore gets paid...minimum wage!
Why do investment bankers and salesmen wear suits? Because they are more comfortable than 501's and t-shirts? Nooooooo....
Once the cockpit door is shut you can listen to your ipod and wear anything you like (just please wear SOMETHING...ok, ok exception for HMP

) My tie sure as heck doesn't stay on when the door's closed.