Bats are mammals that are born with wings. Because of their functions they have been unable to take much weight on their limbs. They are not strong to help them walk. Therefore, they lie upside down or hand themselves like that in caves. As they take up weight on their wings it also helps them to cling to their offspring. The gravity also exerts a downward force, so the offspring stays in touch with the midline clinging.
Bats hang themselves and hunt their prey as the night sets is not because of the myth that they have wonderful night eyesight. The high frequency sound made by bats is just to know the prey or what is lying ahead of them; this is because the sound, which they produce, reflects back.