Marcellus is not just referring to things to come when he says that "something is rotten in the state of Denmark," but of things already visited upon them -- the ghost itself and the war with Norway.
In Act I, scene i, it is Marcellus who questions Horatio about the marshaling of troops and equipment for war that he sees in Denmark. Horatio explains how Hamlet Senior has killed Fortinbras the elder and taken his lands, and that now young Fortinbras will fight Denmark to win these things back. This is no idle conversation. They have all witnessed the ghost walk before them in armour, and they are trying to figure out why the ghost would walk amongst them dressed for battle. This continuing conflict with Norway is the reason, they assume. Barnardo says:
I think it be no other but e'en so.
Well may it sort that this portenteous figure
Comes armed through our watch so like the King
That was and is the question of these wars.
I think that Shakespeare is going to such trouble to give a motive (separate from his murder by Claudius) for the ghost's appearance, so that it is very clear that Hamlet will be alone in his suspicion and knowledge of Claudius as a murderer.
So, later when Marcellus says "Something is rotten in the state of Denmark," he's literally referring to the conversation had with the others earlier in Act I about the preparations for war against Norway and the appearance of the ghost which, he believes, has come in relationship to that event.
It is interesting and significant that it is Marcellus, a lowly guard or watchman, who makes the claim that this ghost's arrival suggests nothing but bad things for the state of Denmark. Earlier in this act, Hamlet comments that Denmark is like an unweeded garden and that "things rank and gross in nature possess it merely." Shakespeare is establishing a motif of disease and decay imagery and language, and this trouble for Denmark is not just noted by the noble characters like Hamlet, it is noted by the common people as well. The health and state of the Kingdom doesn't just affect the courtiers of King and Queen, it ultimately affects everyone -- and that is, in fact, where the play ends -- with Denmark losing his natural born leader, and losing itself to Fortinbras' rule.