The story that the Ancient Mariner tells the Wedding-Guest is one of great tragedy and solemnity. After the beginning of the story, the Wedding-Guest is horrified, thinking the Mariner is a ghost. The Mariner has to calm this fear:
Fear not, fear not, thou Wedding-Guest!
This body dropt not down.
This quote means that the Mariner did not die with the others. The Wedding-Guest experiences a horrifying story that makes him question if the being telling the story is even alive. This horror immediately takes away the merriment that he would have felt if he had gone to the wedding unhindered.
The sadness comes from the tragedy and guilt in the story, but the wisdom comes from realizing the importance of loving all forms of innocent life. The Mariner explains that he was punished greatly for needlessly killing an albatross. This crime was so great because the albatross was only helping the crew. There is a moral to the story which causes the Wedding-Guest to ponder the importance of praying and spending intentional, solemn time with good people.
O sweeter than the marriage-feast,
'Tis sweeter far to me,
To walk together to the kirk
With a goodly company!—
The story gently rebukes the frivolity of the feast, and this causes the Wedding-Guest to become pensive.
He went like one that hath been stunned,
And is of sense forlorn
The story shocks him into deeply pondering life. This kind of pondering often leads to a sadder but wiser individual. Tragedy, especially tragedy that is a result of a foolish action, can result in deeply reflecting on humanity and how to live correctly. This reflection is what the Wedding-Guest is beginning to do, and it draws him away from the party.