Horatio believes that the ghost of the old king is an omen of bad tidings for Denmark. He cites an example from antiquity when, just before Julius Caesar was murdered, people saw ghosts as an indicator of bad things to come. I have quoted the passage below.
A mote it is to trouble the mind’s eye.
In the most high and palmy state of Rome,
A little ere the mightiest Julius fell,
The graves stood tenantless and the sheeted dead
Did squeak and gibber in the Roman streets
As stars with trains of fire and dews of blood,
Disasters in the sun, and the moist star
Upon whose influence Neptune’s empire stands
Was sick almost to doomsday with eclipse.
And even the like precurse of feared events,
As harbingers preceding still the fates
Have heaven and earth together demonstrated
Unto our climatures and countrymen.
When Horatio says that the "graves stood tenantless," he means that the people who were buried left their graves. He goes on to say that these ghosts were speaking gibberish in the streets of Rome. Other examples of horrible omens happened in Rome, just like in the current scene in Denmark. All these things together point to the idea that "heaven and earth" are trying to warn the people in Denmark of whatever will happen next.
Just before the passage above, Horatio summarizes the main points of the war that occurred before the beginning of the play. Hamlet
's father, the king of Denmark, caused the war, and he himself killed the old opposing King Fortinbras
. This dead king's son, also called Fortinbras, is now getting ready to try and seek revenge. Given this tense history of war and the link between fathers and sons, it seems appropriate to the guards that the ghost of the late king would be the one to appear as a bad omen. One of the other guards Barnardo says as much:
I think it be no other but e'en so.
Well may it sort that this portentous figure
Comes armèd through our watch so like the king
That was and is the question of these wars.
Here, he suggests that the old king was the cause of the wars, so it makes sense that he would be dressed in his battle armor appearing to the people of Denmark now.