While I might agree, I see the problem is that religion has, at the same time, made up the spiritual realm.
My own personal take on the origin of the belief in life-after-death is that the living often have dreams about the dead. This can feel very much as if the dead person is “alive again” in some way, talking to us. I’ve had those dreams, and even for an educated person in a technologically advanced society, it feels very much like a visit from the dead. To primitive people, not having the sophistication to understand what dreams are, the easiest explanation is that gram’paw is “alive” somehow, even though dead.
The same is true for all “spirit” manifestations. We know it’s just wind, weather, the occasional earthquake, and our own imagination. But primitive people imagined spirits, and then made up complicated religious rules (“You must walk to the left of the stupa”) to placate these imagined spirits.