I'll refrain from being cynical and a bit defensive as posters above seem to have been, and give you a few pointers as to what else a guard may be called upon to do.
A guard will, if not incapacitated, be required to assist with emergency safety in the event of an accident. They will be trained in protecting the passengers and the train, and will know how to react to the requirement to detrain, if the worst comes to the worst. If a passenger alarm is activated, the guard will often investigate and pass back information to the driver.
As you will know, guards also pass on information over the manual PA system, where a driver may be too busy or might get distracted by doing so. This information could be about ETAs, connections, disruption, safety information or information about the train (and its facilities) itself. They have, on occasion, also been known to override the automatic announcements where these are incorrect.
When in stations, guards can of course be seen advising and helping passengers, and checking the safety of the train before it moves - thus the job is not just "opening and closing the doors"!
Passengers do get reassured by the presence of trained staff on board with them. Vulnerable people are often especially grateful that staff are in the passenger area.