I think there's a deeply-ingrained sense of being in love with our cars, loving to do things in our cars, etc. We made long commutes via car a thing, and I think a part of that was the drive-through - you could get things quickly on your way to/from work.

There used to be a time where the drive-through was a pretty great deal but - for all the reasons you outlined above it's losing a lot of appeal. I think you pretty much hit the nail on the head - businesses prefer drive-through because it requires less staff, less resources. You also eliminate issues with people loitering in lobbies.

There are places where drive-through/walk-up only may be the only way a restaurant will open due to perceived safety concerns. So that I kind of get but ideally, the municipality would find a way to address the actual safety of the area, or at least the perception. Sometimes areas just look dangerous but are actually fine.

But yeah I think the appeal of drive-through is dying out for a variety of reasons. We no longer see cars as convenient, we desire walkability, we value healthier food over faster food, we'd rather work less and have extra time at home to do things like cook, things like that.

I should point out I'm speaking very broadly, as an American who isn't facing poverty. My view is likely limited and skewed, there are very likely to be scenarios I'm not considering.