Why do bats poop on the wall?

Why bats go to the bathroom or poop on the wall? Bats defecate on the wall near the entry point and many websites are quick to point that out but no-one has ever answered the question of WHY. Why do bats do that? I have a theory. I believe that they do it inadvertently. As a