Shakespeare wanted to introduce the ghost before it met with Hamlet. The Ghost is played by an actor wearing armor and a helmet. The audience would not take this actor to be a ghost unless it was clearly established that he was indeed a ghost. So the main purpose of the opening scene was to have Marcellus, Bernardo, and Horatio all testify that this actor was a ghost and that he looked exactly like the dead King Hamlet. Prince Hamlet himself does not have his conversation with the ghost until Act 1, Scene 5. The ghost is only there because he wants to tell his son he was murdered by Claudius and to pledge young Hamlet to take revenge. But Shakespeare did not want his audience to think that the ghost had an important message for his son. The playwright wanted the information in Scene 5 to come as a complete shock and surprise, not only to Hamlet, but to the audience. Therefore, Shakespeare invented an issue in Scene 1 which was really a distraction, a red herring. Marcellus, Bernardo and Horatio talk about the possibility of an invasion by Fortinbras. This explains
Why this same strict and most observant watch
So nightly toils the subject of the land,
And why such daily cast of brazen cannon,
And foreign mart for implements of war,
Why such impress of shipwrights, whose sore task
Does not divide the Sunday from the week.
It also beguiles the audience into thinking that the ghost is there because it is concerned about military matters. This false belief is strengthened by the fact that the ghost is wearing armor and a helmet. Shakespeare wanted to make the ghost look different from the other actors, but he did not want to dress the actor in a shroud, and he did not have the technical facilities so readily available in Hollywood whereby the ghost could be transparent or floating in the air and speaking through a filter that would make his voice sound spooky. The audience just has to understand that the actor in armor is a ghost and that he looks exactly like Hamlet's dead father.
Once Shakespeare introduced the Fortinbras issue, he decided to continue with it as a subplot. The threat of invasion turns out to be a false alarm. It is all settled by Act 2, Scene 2, when Voltimand and Cornelius return to announce that the Norwegian king has ordered his nephew Fortinbras to cease and desist. But Fortinbras will remain in Denmark with the permission of King Claudius to pursue a military objective against Poland, and in the last scene of the play he will finally appear in person and the dying Hamlet will nominate him to be the new king of Denmark. This is how Shakespeare justifies the use of Fortinbras' threat as a "red herring" to keep his audience from guessing that the ghost is present because he has an urgent message for his son.
Scene 1 or Act 1 is therefore mainly important because it introduces the ghost and establishes that it is not only a real ghost but the ghost of Hamlet's father. The ghost's revelations will affect everything that happens throughout the rest of the play. The ghost is there because he wants Hamlet to kill Claudius, and in the last scene of the last act Hamlet finally does kill the villainous murderer and usurper.