Doors separate and also provide entrances and exits.
Exterior doors are often part of our first impressions of a building. In some cases, some houses have doorways that are impossible to enter or exit through without stairs built or ladder used to get through the highest point of the doorway. An example of that could be an entrance to the attic from outside.
Doors also provide a way of separating rooms and an indications of whether the occupant is currently available. Doors provide privacy. They also restrict the air circulation. Doorways and thresholds can be an impediment for some people.