Maybe this is too simplistic, but I could see a primitive society connecting filth with sickness (either causing it or resulting from it). Seems like disease would also have been linked to malign spiritual forces; people might have made the association that cleansing prevented the evil demons from making them sick, or…