Modesty is a social norm, it does not apply where it cannot, such as in an emergency. In the case of an emergency it is more important that doctors treat those that are wounded. It does not matter that doctors may see those people naked. In some cases, it may be necessary that they take off all the clothes, to be able to treat them better.