In a perfect world, you're right. People would be judged by their abilities, not their appearance. But it's the same reason why people judge each other's appearance when looking for a mate. It's human nature.
Anyone who deals with the public on a daily basis needs to be aware of their appearance, and how it reflects on the company. If you work in a cube or on the phone all day and have no face-to-face contact with people, then whoh cares what you look like.
But if you deal with customers, you need to present an image that will make the customer feel comfortable, and personally, when somebody has a bolt through their nose and a grommet in their earlobe and tattoo "sleeves", that doesn't make me want to visit that store, regardless of how nice or knowledgeable the person may be.