A Google search doesn’t really provide me any answers but I do have some ideas on why the doors would close:
1: Time Efficiency (As stated by Andrew, Ruudt, and Angelo)
Closing the door reduces the time the elevator needs, to move to a different floor when someone presses the button.
2: Safety (1)
When a door stays open and a user approaches the elevator, the door could close at the moment when the user enters the elevator, which could cause a problematic situation. Opening a door on request, lets the elevator know there is someone who wants to enter.
3: Safety (2)
Generally elevators have double doors. One on the elevator itself and one on each floor, that opens whenever the elevator is at the right floor. To prevent people from falling down the shaft, both doors open at the exact same time via a mechanism. Keeping the doors open could possibly pose a hazard here of having the outer doors stay open while the elevator is not on the same floor.
4: Safety (3)
Young kids, pets or wild animals are less likely to manage entering the elevator while it waits, since they won’t be able to press the button.
5: Energy Efficiency
Elevators tend to turn off the light when it is still waiting a new user to save energy. An open elevator with the lights off (to conserve energy) would give off the impression of a broken elevator, even if the lights were to turn on whenever a user steps in the elevator. Closing the doors and turning off the lights doesn’t have this problem.
Disclaimer: I don’t have research to back this up unfortunately. Just my two cents here.
Edit to conclude my list of reasons
It occurred to me that the main reason for closing the doors is an historical/cultural thing. Originally, doors were put in an elevator to prevent people from falling down the shaft. It’s inventors weren’t necessarily concerned about speed and efficiency; just safety. (Late 1800’s)
Currently the main purpose of elevator doors still is safety. And although we have improved the technology over time, an open elevator poses possible threats because of faulty technology. Furthermore, it could also be perceived as more dangerous because we are not used to it.
Closing an elevator door is consistent with the behavior we believe is normal since that is the way they have been since the introduction of elevator doors. Keeping it open could induce a feeling of insecurity when entering the elevator.
Closing the door for the floor the elevator is on reduces the time, the elevator can serve another floor upon request. The time is saved due to omitting the door closing step.
Considering that elevators usually serve more than two floors this speeds up the more frequent use case.
There are several answers about reducing time for people calling the elevator from other floors, however while desirable, I believe that is a secondary benefit.
Safety trumps convenience.
Typically, automatic door closure is related to an emergency situation.
An example might be that a fire (possibly as yet undetected) has occurred on a floor , or hot or noxious gases are present for whatever reason at one level of the building.
Automatically closing the doors reduces the potential movement of smoke and/or gases into the lift, so that if the lift is called from another floor, the gases will not be brought from elsewhere only to flow out over unwitting waiters. This may include the possibility of the fire entering the lift itself.
This eventuality may still occur before fires or other issues have been detected and therefore prior to emergency procedures coming into effect.
EDIT Someone mentioned they’ve seen elevator doors remain open when on the ground floor.
This actually still fits the fire safety scenario, for example according to Schindler’s Emergency Operation of Elevator Systems (yeah Schindler’s Lifts!):
If a smoke sensor is tripped, either above or below the main lobby,
all cars in that bank will recall, running nonstop to the main egress
level and secure themselves with their doors open.
Thus doors remaining open at the main lobby reduces the time between an emergency being triggered and the final state being reached – (i.e. zero time)