Ironically that wasn’t to prevent theft; it was just considered to be better customer service.
It probably saves a ton of space and tidying, but at the expense of needing more staff to serve.
It would be beneficial in total labor today, especially in a store with employees picking for curbside exists. Stocking is a big effort overnight. Restocking is problematic during the day, and costs sales. These normal processes (busy people doing stocking and ordering, and inventory existing in 2 places) makes ordering harder. If customers would accept the change it might happen. The rub is studies show customers don't like it, and no browsing means lower sales.
In El Salvador all groceries and pharmacies have a tiny window with metal bars. You ask what you need from the street and they give it to you through the bars.
Al Jazeera English recently showed a documentary about street gangsters in Port Moresby, New Guinea (apparently a very dangerous place), all the grocery stores looked like that.
It might have to go back that way, or I'm thinking that US chains might look at the staffing costs and figure out something like how to deploy the largest versions of the vending machines seen in Japan.
Or just everything via Amazon.
This was how Redbox started. It was a joint venture of Coinstar and McDonald's.