As Marcellus ruefully observes, there's something rotten in the state of Denmark since Hamlet's wicked uncle-stepfather Claudius murdered his way to the throne. As king, Claudius sets the moral tone for his subjects, and so it's no wonder that, with him on the throne, the overall moral standards of the kingdom have declined sharply.
In particular, betrayal seems to have become the norm, and Hamlet, for one, is thoroughly disgusted by it, not least because he's often on the receiving end of one kind of betrayal or another.
The people that Hamlet always thought he could trust—his mother Gertrude, his beloved Ophelia—betray him in different ways. Gertrude betrayed Hamlet by marrying Claudius, and Ophelia betrayed him—albeit inadvertently—by participating in her father's scheme to try and determine if Hamlet's genuinely taken leave of his senses. Even Hamlet's old school chums Rosencrantz and Guildenstern, betray him by spying on him for Claudius.
Under the circumstances, it's not altogether surprising that Hamlet finds it very hard to trust anyone. Though he himself is very far from being morally pure, he's a paragon of virtue by comparison with just about everyone else at court. Deeply flawed though he may be, but Hamlet's very much the moral center of the play, and Shakespeare's development of the themes of betrayal and trust serves to emphasize this.