I discussed this in a lot more detail in my article on the pekapeka (a bat from New Zealand that spends about half its time on the ground), but in general, here are the reasons:
1. Compared to other flighted animal groups like birds and insects, bats are relatively new on the scene evolutionarily. They evolved flight about 52 million years ago. Compare that to birds, which have had about 150 million years to get comfortable with flying- only a few have ever lost it in that time.
2. Flying is a powerful antipredator defense and allows bats to get at resources they wouldn’t normally get, like flying insects and high-hanging flowers and fruit. This means there is currently strong evolutionary pressure for bats to retain flight in most parts of the world. One example where there was not was New Zealand (until recently). Even then, the pekapeka and its relatives retained the ability to fly.
3. Compared to birds, bats may simply be too specialized for flight to go back to being completely terrestrial. All living bats have modified hindlimbs and pelvises for flight, because their legs actually make up part of their wings.
It may be difficult to tell from that picture, but a bat’s hind legs are rotated at 90-180 degrees (depending on the species) around from where an ordinary mammal’s would be. In other words, their knees point backwards.
(This is different from a pterosaur, by the way- pterosaurs had wing membranes that attached to their hind limbs as well, but retained forward-pointing knees.)
This makes walking on the ground very difficult for them, and is related to why they roost upside-down. (In fact, some species of bats CAN’T walk on the ground at all!) Even when bats have regained the ability to be good walkers, like the vampire bat has, the style of locomotion is very different from all other living animals, like so:
It’s not a BAD way to get around, but energetically, it’s not as efficient as regular quadrupedal walking.
So, for a bat to “de-specialize” from flight completely might require extreme evolutionary pressures that don’t exist on earth right now. Not that I don’t think they could do it- but a flightless bat would end up looking really, really weird, compared to the mammals we’re used to.