I've got some mixed feelings about this one, too. Before I joined the military, my entire wardrobe consisted of jeans and t-shirts, black or tie-dyed, depicting either hard rock bands, or fantasy images (wizards, dragons and the like.). I was always one to believe that exterior appearance was not enough to judge a person by. Once I came into the corps and started getting classes and PMEs on "appropriate civilian attire", I was ready to raise the bullsh*t flag. Just the idea that we're required to wear a belt with any pair of pants/shorts that have belt loops used to piss me off. I conformed (I didn't really have a choice. 🙄 ), but in my stubborness, I was still wearing t-shirts with some "borderline-eccentric" images on them. My personal favorite that I liked wearing is a Liquid Blue t-shirt that depicted a drawing of a face, with the head on fire, and an eyeball that had arms and legs trying to crawl out of the socket. Quite a disturbing thing for others to look at. Unfortunately, Liquid Blue removed it from their product line (I wonder why?).
After spending a lot of time in a military town, where pretty much everyone has a high-and-tight haircut and scrutinizes everyone around them for appearance discrepancies(I'm guilty of it myself!), my mindset began to change a little. It kinda sucks when you're trying to look into a major purchase, and no sales personnel are willing to take you seriously, because you're wearing an old, tie-dyed t-shirt. It wasn't a reality I was willing to accept, but that's life. We live in a world where first impressions can make or break you. After a little influence from my wife and fellow co-workers (brainwashing, change of attitude, call it what you will.), I attempted to dress a little more professionally. I've learned that not only will people take you more seriously when you dress nice, but I can also take pride in looking good. It did take a little time to get used to. I got frustrated going into a restroom to wash my hands only to find out that there were no paper towels, and I couldn't dry my hands on my pants, because I was wearing khakis instead of jeans! 😛 The compliments I received from people outweighed this little annoyance. Don't get me wrong, though, I still dress like I always have. I'll still wear my "relaxed" clothes, but that's when I'm just with my friends in a relaxed environment. If in a restaurant or business setting, I'm wearing a button-up, collared shirt, tucked into a pair of creased khakis, wearing a dress belt.
As far as the library's particular dress code, the dress/long skirt thing is ridiculous. Wasn't the dress/slacks barrier destroyed way back in the 50s/60s by Mary Tyler Moore? I don't see why they couldn't wear slacks. As far as jeans, I don't know of too many work environments that permit denim to be worn (Not even Burger King permits it for their crew.), and in the rare cases that denim is permitted, it has to be black, with no fading.
I don't know about a library, but in my job (on the rare occassions that we're permitted to wear civilian attire to work.), sandals and open-toed shoes are not permitted because of safety reasons. In a tech shop, there's a lot of heavy equipment that could be dropped on someone's foot. I guess the same logic could be used for really heavy books, or something to that extent. Other than that, I have no idea why sandals and open-toed shoes would not be permitted.