Spirits/ghosts come in different catergories
Residual haunting activity can occur when something traumatic/stressful occurs, such as a murder or a rape. Negative energy is literally blasted into the atmosphere, causing the atmosphere to imprint or record the events. Like a recording tape, it will play the events over and over again. The entities involved in this residual haunting activity are unaware of their surroundings. This is not an intelligent haunting, there is no interaction between you and the entity.
Residual haunting activity can also be caused by positive energy blasted into the atmosphere. Many times you have heard ghost stories, where people can hear the sounds of a party. They hear music, singing, dancing, laughter and when they enter the room where they hear the party, there is no one there. Residual haunting activity can be the specters of living beings.
((This is what I think a lot of people experience.))
Poltergeist activity is usually caused by an adolescent teenage girl going through puberty stages. During this stage of development, a young girl can harbor an extreme amount of inner energy. This energy can be projected with the mind, which can cause tapping sounds, the movement of objects, lights flickering off and on. Poltergeist activity usually originates from a human being.
((I don't know if I believe all that))
Intelligent/Interactive Activity:
Back to Einstein's theory. As matter beings, we are all energy beings on the quantum level. We are made up of atoms and neutrons. As matter/energy beings we have intelligence. While we live, we have an energy aura that surrounds our living bodies. This aura is created by the millions of electrical currents that are created through our bodies. Our brains creates brain waves, a form of pure energy that is transmitting our thoughts, what we see, what we feel, etc.
When our mortal form dies, the aura that constantly surrounds our bodies, leaves our bodies. We lose 6 ounces on the instance of death. What is this 6 ounces? Perhaps it is energy leaving our body. Our soul. This energy, the aura, or you may even call it your soul, is carrying the information of what we used to be. If it can do this, then why couldn't it also carry our intelligence? If it can carry our former intelligence of our previous life, then it should be able to interact with us intelligently. When we see this aura, we call it a ghost.
If this ghost is able to interact with us, is aware of us, can touch us, can communicate with us, then this is an intelligent/interactive haunting.
(( I doubt they half of the reports on these types of hauntings are true, people do make mistakes. It's in our DNA))
But to answer the question, I don't believe most spirit haunting have a purpose.
"When you think night and day and every moment only of pleasing me, things will be very easy for you."