Guilt and loneliness can cause a person to question things they have done in more detail than a normal person would. Both weigh on the mind heavily. His guilt over the death of the harmless bird and the subsequent deaths of his fellow crew members cause him to see the beauty of the individuals and their role in life. His prayer for both lead to the ship's movement toward home.
His loneliness as being the sole survivor is documented in many real life stories. It is called survivor's guilt. Why did I survive and others didn't? Did I deserve to live? What am I supposed to do with what I learned? I'm a flawed individual who didn't deserve to live. Imagine being alone on a becalmed ship with a dead, huge bird hanging around your neck (phew) and 200 dead men's eyes staring at you! His loneliness would cause him to talk to himself, and fearing insanity, he might just give those voices a personality-that of spirits. It's like the little devil and angel that sit on one's shoulders and talk to them before a decision is made! His loneliness will manifest itself in spreading his story to those he feels need to listen.
In Coleridge's "The Rime of the Ancient Mariner" guilt and loneliness are symbolized most notably by the figure of the Mariner himself.
He is cursed for the rest of his life to wander and, when the urge and pain come upon him, to stop whoever he is directed to stop and tell his story to that person. There is no one else like him, and the obsession to tell his story is beyond his control.
His guilt of course comes from his killing of the albatross, one of the creator's creations. As the Mariner tells the wedding guest:
"He prayeth best, who loveth best
All things both great and small;
For the dear God who loveth us,
He made and loveth all." (lines 614-617)
This is the lesson in the tale the Mariner tells, and is doomed to tell.