This scene is important because it helps to establish Fortinbras as a foil to Hamlet. Fortinbras is a young man of action, a warrior, someone with a sense of honor. So when he and his army pass across the stage (as the stage directions state), they can convey a sense of this. As a director or actor, who do you want Fortinbras to be? Someone who seems good and noble? Brash and arrogant? Sinster? On stage, the passing over of an army is done with relatively few actors, of course. In a movie, however, you can actually show a large army (as in Kenneth Branagh's version).
Later in the scene, a Captain speaks with Hamlet and states that they are to fight over "a little patch of ground / That hath in it no profit but the name." One could try to convey the sense of war-weariness or even a pacifism. Is Fortinbras' action and honor worth it?
Finally, this scene ends with Hamlet's last soliloquy. The army has passed on, the Captain rejoined it, and Rosencrantz, Guildenstern, etc., leave Hamlet alone for a few moments. Fortinbras' action, Hamlet says, "spurs [his] dull revenge" (34). That is, Hamlet wonders why he has delayed so long in avenging his father. The question of Hamlet's delay is a much discussed issue, but the speech is about more than just that. For example, if man is above the animals because we have "godlike reason" (39), are we really acting reasonably when we "find quarrel in a straw [i.e., nothing or something trivial] / When honor's at the stake" (56-57)? Hamlet ends by claiming that his future thoughts will be either "bloody" (68) or worthless. But the one time Hamlet acted without thinking and did a bloody deed, he stabbed and killed Polonius. It is clear that he still has some developing to do, which is what happens between the end of this scene and when he appears again in 5.1.
I always thought the way it was staged in Branagh's film production of the play, the one I am most familiar with, was a bit odd. The distance between Hamlet and this great army was too wide, given the power it seems to have on him.
I would rather have them marching past him, close enough to feel the stamp of their feet and to hear the horse's hooves so that the audience too can understand this moving force that finally brings Hamlet to feel he must actually start acting on his thoughts and revenge his father's murder.