Many people today don’t know what business attire is, or how to dress modestly, or how to wear clothes neatly.
Hence, dress codes.
Remember when people taking flights wore suits?
Times have changed (and not for the better).