The purpose of the lines is to introduce the ghost. He says what kind of a night it was and describes the setting in which they saw the ghost. They comment on how the ghost resembles the dead king. We see that Hamlet is not the only one that sees the ghost but rather more people.