Spiritual Meaning:
Spiritually to be close to someone is to have empathy with them. A closed door suggests that an opportunity has passed.

Psychological / Emotional Perspective:
We can indicate to ourselves in dreams the fact that we are emotionally closed within a situation. This often manifests as a sense of being closed in.

Everyday Material Aspects:
To be close to someone in a dream can mean we are looking for intimacy,  or perhaps protection. To close a door acknowledges the fact that we must make a decision to put the past behind us.

Consult the entries for Door and Trap / Trapped for further clarification.