At this point in the play, the other principal characters are dead, or, in Hamlet's case, dying. Horatio, however, still lives and has long been Hamlet's good and trusted friend. Horatio knows all about the ghost of Hamlet's father and has witnessed Claudius's guilty reaction to the "mousetrap" play. In a corrupt court filled with liars and sycophants, Horatio is one of the few people Hamlet can rely on. We also know that Horatio is a rational person, not given to flights of fancy, and that he has steered clear of involvement with the intrigues that have brought others down.
People still alive don't yet know the true story of what caused the deaths of all the bodies now littering the court, or what happened to Hamlet's father or that Hamlet avenged his father's death. If the correct version of events is to be passed down, Hamlet knows he must rely on Horatio to tell it.
The other people at the court know virtually nothing about Hamlet's problem or Hamlet's story, since the principals are all dead--Polonius, Ophelia, Laertes, Rosencrantz, Guildenstern, Gertrude, and Claudius. Horatio has actually seen the Ghost and has been with Hamlet at the play within a play when Claudius's guilty behavior proved that the Ghost was really Hamlet's father and was really telling the truth. Hamlet wants his story told to the general public so that he won't be thought of as a man motivated by ambition and generally wicked motives, even though he was either directly or indirectly responsible for all the deaths in the play. It may have been that Shakespeare wanted to tie up any loose ends by leaving one of the principal characters alive to explain the complex plot and justify Hamlet's behavior.