How some person become Ghost after death
When a person dies only his gross body ceases to exist. His subtle-body however continues to exist and moves on to the other regions of the universe. Refer to the picture below for more detailed view of what we are comprised of and what we leave behind after death.
Only people who have reached the 50% or 60% spiritual level and have low ego are able to proceed to the higher regions of Heaven and beyond and do not become ghosts. The rest of humanity, when they die, finds themselves in the regions of the Nether world and Hell. Most subtle-bodies in the Nether region are highly likely to become ghosts. All subtle-bodies in Hell are ghosts.
In fact, even if one is a gentleman but doesn't have enough spiritual strength through spiritual practice, he is liable to become a ghost when he dies. This is because he is attacked by higher level ghosts and is controlled by them.