Gertrude seeing the ghost would have served no purpose in the play, or it would have been counter productive. The ghost could appear and disappear at will. He need the guards to see him, so they would pass the word on to Hamlet. He needed Hamlet to see him in order to send Hamlet on the road to revenge. Gertrude would have simply fouled up the entire plan.
Maybe women cannot see ghosts? Seriously, perhaps the fact that only Hamlet sees the ghost in Act 3 whereas the guards, Horatio, and Hamlet saw the ghost in Act 1, shows Hamlet's mental state. Perhaps he is becoming as mad as he is pretending to be. His actions are that of a mad man, or at least of a son who has become "passion's slave." He has mistakenly killed Polonius.
Despite his contempt for Polonius, Hamlet seems to be truly sorry for what he has done. And, he still must face Gertrude with the upsetting fact that they are conversing with a dead body in the room. Emotions are running high for each of them and Hamlet speaks to his mother, releasing all his pent-up anger and frustration on her. He, in short, is mad with anger, guilt, and frustration, and Gertrude at least is partly to blame for her "o'er hasty marriage" to Claudius.
The ghost's appearance reminds Hamlet of his promise to "leave her [Gertrude] to heaven." Hamlet calms down after the Ghost's appears to him. Since it is Hamlet that has been charged with carrying out the ghost's commands, it is Hamlet that the ghost reveals himself to.
But there are many properties of ghosts that this play explores. I didn't know before reading the play that ghosts spoke Latin, that ghosts change clothes, and perhaps male ghosts can only speak to men.
It does seem to me that having Gertrude see the Ghost somehow changes the story. Hamlet is beating up on her despite his earlier promise to his father; however, there would, I think, necessarily be a reaction on Gertrude's part if she actually saw her dead husband in her chamber. Her reaction, it seems to me, would reveal her motivation for marrying Claudius so soon after becoming a widow. If she acts ashamed, we can guess there was some kind of relationship between her and Claudius before Hamlet's death. If she is saddened or brought to tears by the appearance of King Hamlet, we may surmise it was Claudius's deviousness which somehow won her over. In any case, the Ghost's presence revealed to Gertrude would answer one of the key questions audiences are left with in this play--what was the nature of the relationship between Gertrude and Claudius. I think it sidetracks to storyline to have that revealed here or anywhere else in the play, which is why Shakespeare doesn't let Gertrude see the Ghost.
Perhaps the ghost can only be seen by those who need to see him. Hamlet needs to be brought from his anger with his mother back to the real purpose of the play, which is to avenge his father's death. Hamlet, in this scene, is doing exactly what his father, the ghost, told him not to. He told Hamlet to not hurt his mother, but to let her own guilty conscience prick her. When Hamlet sees the ghost he chides himself for what he assumes his father sees as his lack of action.
Another plot point is that everyone in the castle thinks the Hamlet is acting crazy. Hamlet's distracted behavior and conversation with the air (as Gertrude sees it) reinforces her assumption that Hamlet is losing it! Even the ghost comments on Gertrude's expression as she watches Hamlet here.
That's a very good question. Actually, when John Barton directed a production of Hamlet at the Royal Shakespeare Company in the late 70s, he had Gertrude see the ghost. His reason being that everybody else saw the ghost, so why not Gertrude?
Conventionally, however, she does not see the ghost. It would appear that the ghost can select who sees him. He needs the credible Horatio and castle guards to see him so he can speak to Hamlet.
When he appears in Gertrude's bedchamber, he is there protecting his wife. Hamlet, in his impatience, has forgotten his promise to his father concerning her.
One of the fascinating things about the role of Gertrude is how much does she know or suspect? and when does she know or suspect? And how does she react to this information?
The reason Gertrude cannot see the ghost in the closet scene is that she has forgotten her deceased husband. Remembrance is one of the main themes in the play. All the characters who see the ghost see it as they remembered King Hamlet as he lived. Bernardo is the first to tell us that, it is the “same figure, like the king that's dead.” Horatio notes the ghost’s armour which was worn by the king in a particular battles. Marcellus questions that it looks like the king.
Later in scene two when Horatio, Marcellus and Bernardo meet Hamlet to tell him of this spirit, Hamlet is envisioning his father in his minds eye. Horatio then recounts in detail how the ghost’s image conforms with his memory of the dead king. Then in the closet scene the ghost appears to Hamlet: “My father, in his habit as he lived.”