Nearly-Headless Nick talks about how he really is his soul, and that when he died he clung on to life so much that he never "passed on":
"I was afraid of death. I chose to remain behind. I sometimes wonder whether I oughtn't to have… well, that is neither here nor there ... in fact, I am neither here nor there ... I know nothing of the secrets of death, Harry, for I chose my feeble imitation of life instead." -- Harry Potter and the Order of the Phoenix, p. 861
Later, when siriusSirius dies, Harry seeks out Nick and askesasks if there is a chance that siriusSirius is still here on earthEarth as a ghost,ghost; and Nick tells him nohe isn't, because someone like siriusSirius would not try to stay here, he would move on. The
The ghosts also have alota lot of regret as now they are stuck here with no way to move on with their lives or move on to the other side. And
And the Resurrection ring actually pulls people from the other side back into the world, which is why they are "sad", because they are being forced to be basically a ghost on earthEarth again instead of "beyond". though
Though as a side note i, I believe a ghost could go through that portal in the ministryMinistry and probably pass on/ though (though that is complete speculation).