Given that many people feel free to come to mass dressed improperly, quite naturally the effective way to correct this, is by posting guidelines in the bulletin and/or the vestibule.
A dress code of this kind is also less confrontational than having to have repeated sermons on it, when people might have shown up dressed improperly, or personal intervention.
Instead one can simply point to the code, which is less *morally *confrontational too. People are normally proud and disobedient, if you tell them the need to correct something, instead of acting like Christians who know they are sinners and want to learn to live more moral and virtuous lives and make progress, they automatically resist and complain. Goats instead of sheep. They seek to justify their behavior.
So non-confrontational ways of correction are really helpful, and dress codes work in this category.
OTOH, of course, plenty of priests too are not well formed in modesty, and so if a church has a bad dress code minimum, some people will then say, ‘Well father says only this much is OK’, etc. instead of trying to learn the fundamental moral reasons that modesty requires everywhere and being open to the fact that they might have to do far more.
Still…
Modesty is a virtue. But somehow lots of people don’t want anything to do with it. They say, "I am already modest.’ or “I am modest enough.” Or, “It’s irrelevant.” It doesn’t even come into their worldview. This is mostly the case.
But modesty is a -virtue-. A person should be trying to -increase- in it always, and to be -very- modest, and more modest and more modest, and so on, so as to truly please God and shine with this virtue in Heaven and on earth. A Christian -loves- modesty. Rather than trying to do the minimum, or rather the opposite, the vice.
When a dress code is in place, people will more quickly adapt to it and provide a good witness to others. We should be able to see people are Christians by their modesty.
If we do not as Christians give witness to the virtue of modesty… Well… Are we being Christians?
Where Christ is, there modesty is found.