Imagine coming home from school to mourn the passing of your dead father. You have no siblings. Most of your good friends are back at school. Who will you mourn with?
What if your mother was to busy being happy over her new marriage?
Hamlet does feel that his father is betrayed, but he also feels that no one has given him ample time to grieve for his father. His mother and his new step-father keep telling him to just "cheer up". Gertrude says: "Good Hamlet, cast thy nighted colour off". But he misses his dad. All of that is tied into his despair.
There is one other consideration. Many critics feel that Hamlet is suffering from somewhat of an Oedipal complex. Oedipus is the greek king who married his own mother. Sigmund Freud coined the term "Oedipal complex" to indicate a situation where a young man has romantic feelings toward his mother. Hamlet's obsession with Gertrude's intimate behaviors (he mentions them in Act I, scene ii and Act III, scene iv). The sometimes incestuous exchanges between Laertes and Ophelia help to support this idea of a Hamlet distraught by his "Oedipal complex".
Gertrude (Hamlet's mother) and Claudius (Hamelt's uncle and the late king's brother) married very soon after the king's death, which could definitely have a direct effect on Hamlet's emotional state.
From Hamlet's perspective, the marriage is disrespectful and a betrayal against his father. Even though the king's ghost gives clues as to the nature of his death, the marriage itself could be interpreted as suspicious. Because the marriage happened so quickly, that could also indicate foul play in the death of the king. All of these factors have caused Hamlet's despair.