Could you clarify what you mean by that a bit? Because the concept of cleanliness in human societies is much older than the discovery of germs.
I don't have any sources on hand about the connection to Islam, but there definitely existed rituals of washing/cleaning before prayer, after sex or menstruation, and/or before entering holy places in Zoroastrianism and pagan religions, as well as Judaism (mikveh), that predate the beginning of Islam. It's very possible that the washing practices in Islam were inherited from these religions, even if the rituals weren't quite as extensive in some of those other religions as they might be in Islam.
Medieval Islamic physicians/scholars codified and advanced a lot of both Eastern and Western medical knowledge at the time (e.g.,invented soap), which I imagine helped encourage the practice of washing. They also practiced antisepsis during medical procedures including surgery, even before the discovery of germ theory or bacteria.