The skin prevents pathogen entry because
Skin is impermeable to most infecting agents due to the presence of the stratum corneum layer (epidermis). It has many thin layers of dead cells which act as a strong barrier for the entry of microorganisms.
Skin also has certain secretory glands whose secretions prevents the growth of microorganisms. Sweat is secreted by sudoriferous glands whereas sebaceous glands secrete oil. Secretion of both glands maintains the acidic pH level of the skin.