The first law of thermodynamics or conservation of energy is often given as a possible explanation of what comprises a ghost and how it came to be. Whether this misunderstanding is what led many investigators to believe ghosts are made of "energy" or that it was given as a supportive hypothesis of the former in unknown to me and, most likely, to the claimant as well. Though the underlying concept is a pretty common one. It's the general misinterpretation of energy itself.
What is energy really? Energy is a scalar, that is, a quantity of a system's ability to produce changes or do work. In this sense, some one saying "Ghosts are just energy" would be equivalent to saying "Ghosts are just length" or any other measurable quantity. To those making the claim, are human bodies like a jar of fireflies, buzzing with a swarm of glowing, free-floating energy that escapes the moment we die?
If that were the case, then I think they'd most likely speaking of energy in the metaphysical sense. Life force, ki, prana, kundalini, or spirit is the ever-present force connecting all things, giving life, creating auras, and the base of most alternative medicine. It's also a handy reference to explain anything paranormal. While many cultures believe in some form of a life force or another, this "energy" of the body is not detectable in any way beyond the claims of self proclaimed sensitives. And why should it be? It is not energy in the physical sense, so the laws of physics need not govern it, right? If that is indeed the case, then conservation of energy would not apply and that "theory" is busted.
At this point, some might still ask, "What happens to our body's energy when we die, then?"
This is pretty simple to explain. Being that the body is dead, it no longer needs to take in any energy in the form of food. The remaining energy in the body is radiated off as heat and the rest of the chemical energy stored in our tissues is consumed by the body's environment.
I think that pretty well dismisses the idea of spirits lingering due to the first law of thermodynamics, but be warned. After raising these points in a discussion with a believer, be prepared for the guaranteed "Science doesn't understand everything." response.