Just in time for Halloween:
Besides being an excellent way to avoid predators, roosting or hanging upside down is optimal for taking off into flight. Bats are not able to launch into flight from an upright position because their wings do not generate sufficient lift while at a dead stop. Additionally, their hindlegs are rather underdeveloped, so they are not able to run to generate lift for take-off. Instead, bats essentially fall into flight.
Learn more in this video comparing flight mechanics in bats and birds:
Source: Animal Plant