Up until the last 5 years or so of my main career we had to wear a suit and tie every day. Even though I never saw a customer, and supervised a crew of mechanics, millwrights, and construction contractors.
Hair had to be trimmed to not cover your collar or more than the top half of your ears, no beards allowed, mustache couldn't extend down lower than the corners of your mouth. No earrings or other piercings for men and no visible tattoos.
5 years before retirement the relaxed the dress code to slacks & a collared button-down shirt. Then right after I retired they relaxed it even further to jeans and polo shirts. Long hair, beards, earrings for men, Fu-manchu mustache are all OK.
Times have changed. Young folks won't dress to the same standards from decades ago. Wearing a tie is a deal-breaker for them. You want to hire qualified young people, that kind of dress code just doesn't work.