In Pirkei DeRabbi Eliezer chapter 29 (uncensored version), we read:
ולמה מלן, בשביל הטהרה שלא יטמאו את אדניהם במאכליהם ובמשתיהם, שכל מי שאוכל עם הערל כאלו אוכל עם הכלב, מה הכלב שלא נמול כך הערל שלא נמול, וכל הנוגע בערל כנוגע במת. וכל הרוחץ עמו כרוחץ עם המצורע שהם בחייהם כמתים, ובמותם כנבלת השדה ואין תפלתן נכנסת לפני הקב"ה, ועליהם הוא אומר לא המתים יהללו יה.
Why did he circumcise them? Because of purity, so that they should not defile their masters with their food and with their drink, for whosoever eats with an uncircumcised person is as though he were eating with the dog, just like the dog is not circumcised, so too the uncircumcised person is not circumcised. All who touch an uncircumcised person are as though they touched the dead. All who bathe with the uncircumcised are as though they bathed with a metzora. For in their lifetime they are like (the) dead; and in their death they are like the carrion of the beast, and their prayer does not come before the Holy One, blessed be He, as it is said, "The dead praise not the L-rd"
How are we to understand this rather controversial passage?