Pigs are some of the cleanest animals on a farm. In a healthy environment, pigs naturally sleep, eat and go to the bathroom in separate areas.
The idea that pigs are not clean comes from their tendency to wallow in mud when feeling hot. Pigs do not have any sweat glands, so they naturally seek out mud to roll in when the weather reaches high temperatures. Improper farming practices also keep pigs trapped in small cages or unclean cages without enough room to turn. Many farmers are now choosing to keep their pigs cool with air-conditioned barns or water sprays to help pigs avoid the need to wallow in mud.
The idea that pigs are dirty also comes from the fact that they can catch some of the same diseases that humans do, such as the flu. A healthy, vaccinated pig is unlikely to carry harmful diseases.