The "need for privacy" in Shakespeare's Hamlet supports the theme of secrecy (related to "appearance vs. reality"). For the very things that take place out of the sight of others contribute to the conspiracies that abound in the Danish court.
The first portion of the play that requires a need for privacy is the first meeting between Hamlet and the Ghost in Act One. In fact, in order to achieve this privacy, Hamlet threatens Horatio and the others to leave him alone with the Ghost, though they (as would be all Elizabethans) are fearful that this ghost may be evil and try to harm Hamlet.
It waves me still.
Go on; I'll follow thee.
You shall not go, my lord.
Hold off your hands!
Be ruled. You shall not go.
My fate cries out,
And makes each petty artery in this body
As hardy as the Nemean lion's nerve.
Still am I call'd. Unhand me, gentlemen.
By heaven, I'll make a ghost of him that lets me.
I say, away! (I.iv.85-95)
Hamlet warns the men that if they try to stop him, he will kill ("make a ghost" of) that man. His need to speak with the Ghost, and the need for privacy on the part of Hamlet—and seemingly the Ghost, as it leads Hamlet away—is evident.
Another famous scene from the play is between Gertrude and Hamlet, when the son confronts his mother about her actions involving her marriage to Claudius.
As a side note, this privacy is guaranteed after Hamlet mistakenly kills the foolish Polonius, hiding behind the "arras" (curtain) in Gertrude's room.
How now, a rat? [Draws.] Dead for a ducat, dead! (III.iv.26)
Even with the dead body on the floor, Hamlet challenges his mother in privacy—outside the sphere of her husband's knowledge or influence. Here Hamlet makes his accusations: forces Gertrude to see her actions in the light of betrayal to her dead husband and Claudius' actions to make the marriage (among other things) possible:
A bloody deed. Almost as bad, good mother,
As kill a king, and marry with his brother. (30-31)
And again, comparing her first husband to her second...
This was your husband. Look you now what follows.
Here is your husband, like a mildew'd ear
Blasting his wholesome brother. (69-71)
It is during this "private time" that the Ghost appears to Hamlet to restore his "felled purpose" and encourage his son to leave Gertrude's judgment to Heaven.
Need for privacy is at the basis of Hamlet's disgust with Ophelia. Arguably, Ophelia has been called upon to assist the King and her father: she really has no choice. However, while Hamlet would speak to her in private, he knows that she spies for the others, and that the others listen in hiding. He resents this greatly and takes his wrath out (I believe unfairly) on Ophelia. Knowing they are speaking to a hidden audience, Hamlet asks:
Ha, ha! Are you honest? (III.i.112)
This means are you sincere. Then he asks her if she is being truthful:
Are you fair? (114)
Had the two had privacy, and had Hamlet had more faith in Ophelia, he might have shared his concerns with her, and perhaps the fate of those in court might have been altered.
One of the deadliest private meetings is between Claudius and Laertes—who wants revenge for Polonius' death and Ophelia's insanity.
The King notes:
I will work him
To an exploit, now ripe in my device,
Under the which he shall not choose but fall…
He plans Hamlet's death ("fall") with Laertes' help. (67-69)