Because 당신 have to choose to be a ghost. Nick (Gryffindor's ghost) explains this to Harry in the fifth book, after Sirius die. Nick says that almost no one choose this kind of "half life", because it's a very sad existence 또는 something like that
In 1996, After Sirius Black's death, Harry had a conversation with Nearly Headless Nick and he asks if Sirius can come back as a ghost like others and Nick himself, Sir Nicholas explained that only wizards who fear death are likely to become ghosts.
Sir Nicholas: "Not everyone can come back as a ghost" Harry: "What d'you mean?" Sir Nicholas: "...Wizards can leave an imprint of themselves upon the earth, to walk palely where their living selves once trod.., But very few wizards choose that path."
To become a ghost 당신 have to die when you're sad. For example, Moaning Myrtle died while she was in the bathroom crying because someone was teasing her and she became a ghost when the Basalisk ( Hopefully I spelled it right) killed her. Also Nearly Headless Nick became a ghost because he was fixing someone's tooth and it suddenly,out popped a tusk and his head got chopped off part way and obviously he was very sad about that. So there, that how 당신 become a ghost.