Martha of Bethany probably thought that cleanliness was next to Godliness when she insisted that housework was more important than listening to Jesus teach. But Jesus corrected that idea saying that her sister Mary had chosen what was better. (Luke 10:39)
However, this saying is not in the Bible but was coined in a sermon by John Wesley in 1778. "Let it be observed that slovenliness is no part of religion; that neither this nor any text of Scripture condemns neatness of apparel. Certainly, this is a duty, not a sin. 'Cleanliness is, indeed, next to godliness.' " http://dictionary.reference.com/browse/cleanliness+is+next+to+godliness
It found new vigor in 1895 when New York City formed a Department of Sanitation to clean up the deplorable filth of the city (no exaggeration!), with “Cleanliness is next to Godliness” as its slogan. “It recruited an army of street cleaners, the White Wings.” “There were parades of these guys. These guys would march down Fifth Avenue. It's almost like a military exercise.” http://www.pbs.org/wgbh/nova/transcripts/3115_typhoid.html
However, the principle seems to stem from the Law of Moses (Old Testament), which required priests to wash their hands and feet before going into the Temple, and after. (Exodus 30:19-21) Much of life was governed by what was pronounced “clean” or “unclean”, having more to do with holiness than dirt. However, this was more of a ceremonial washing than any deep cleansing (though it helped protect them from the Plague in Medieval times).
Yet Jesus’ disciples didn’t even wash their hands before they ate (a ceremonial tradition of the elders). When the Pharisees complained, Jesus rebuked them saying that which is on the inside of a person is what makes him clean or unclean—not the outside. (Matthew 15:1-11; Matthew 23:23)
Outer cleanliness can be a good thing, if not carried too far (it’s a subjective notion anyway!) but it will never make you holy. Why not focus on Godliness instead of “the next thing to it” and sit at Jesus’ feet like Mary and learn from him?