I am afraid of ghosts, though I don't believe in them
Lots of fears and phobias aren't rational. Our responses to them are rarely rational. As @EmeraldJewel said they can be left over from a childhood trauma we can't even remember, we just remember to be afraid.
When I was young one of my parents friends was afraid of the moon, she knew it was ridiculous, she even knew when and where the fear came from (older kids dressing up and terrorizing her when she was about 4) but she still couldn't go out at night if the moon was going to be up.
I wonder if there is something instinctual about that kind of apprehension. Fear of ghosts seems to me like some more general fear of the unknown---what might be lurking around the next corner, hiding in shadows, etc. IT could be a visceral, skin-crawling reflexive reaction that the brain then gets carried away with extrapolating fantastical explanations for those feelings.
Unexplained things that go "bump" in the night would make most people nervous, even if they don't know what they are.
I doubt dead people bother living people that much, although I've read researched/authenticated accounts of people who remembered times inbetween reincarnations where they were ghosts and did things to people.
Later, the researchers looked up people in their past to whom they'd done those things as ghosts and those people not only remembered, but often had proof. In this research, they only recorded the accounts of young children, between the ages of two to six, who still remembered their past lives, and had no previous contact or knowledge of the people in those past lives.
Even though I agree with everyone who has said this is irrational and ridiculous, I can relate. It really has more to do with having an over-active imagination that chooses to run wild when I am alone in the dark. It doesn't help that I have an affinity for creepy stories. And it's certainly no coincidence that my "fear of ghosts" rises right after I have seen or read something scary.
I recently read a story in which the narrator was being followed by what appeared to be an elderly woman, based on her stance and attire (her face was veiled, so he didn't get a clear look at it). When he arrived at his gate, he saw that her feet were pointed backwards. He ran inside his house and didn't see the lady again. Years later, his daughter was doing a report on urban legends. She described this lady exactly as he had seen her, backwards feet and all. If I remember correctly, she appeared for the sole purpose of scaring people.
Now, I know damn well I'm not going to see a veiled old lady ghost with feet turned backwards. But did that stop me from picturing that exact image as I was walking to my car the other night? No. Is the backwards feet lady real? No. Are ghosts real? No. Is my irrational fear real? You bet your ass it is.
lol cmon! if you're afraid of them perhaps some small part of you still believes in them or won't quite dismiss them entirely. I wish that ghosts existed, what an interesting world we would have and that paranormal science would truly flourish. But no real evidence ever emerges because it ain't real.
I love it when my cat sits on my lap and stares fixedly at something not there just above my shoulder?
I usually say "Heath! Knock it off!".
Now when that doesn't do it I get up and grab my walking stick and peer down the stairwell. Frankly I usually feel he's pulling my leg.
I believe in them, but on the whole they don't scare me ... too much. I had a very definite experience of one, that of course all the super sceptics will say was a cat, possum, cracking wood, whatever ... but it wasn't any of these. It was someone walking back and forth in the room upstairs in a house where I was certain no one but me was. It was creepy but not ... totally terrifying. I just certainly did not want to go upstairs and check. I later told the owner of the house and she said, "Ah, so you heard it, too. I never heard it myself, but my friend did. I didn't tell you as I didn't want to scare you, ..." So, two people independent of one another had the same experience, which makes a spontaneous hallucination on my part (as explanation) much less likely. And cats don't walk like humans. or ghosts.
I have lived on Indian Reservations, which has nothing to do with this topic other that it is where the experience happened. I have seen ghosts. Experiencing them is something that can change the way you see the world. I am not afraid of them. Used to be, but things have changed.
As for your fear, as I used to also be afraid of dark places, even if I have a thorough knowledge of the space. This changed when I saw the Movie "Alien" which I do not recommend if you have not already seen it. I realized that if there was something dangerous in the area it would have probably already attacked me. This does not apply to areas outside where you do ot have control. Alleys and parking lots can be dangerous places. Under your bed or in the closet are what I am talking about. Maurice Sendak I think wrote something like "Monsters in the night closet" for children, read it to mind and they enjoyed the story. Do remember that fear can have its good side.