Never really find out the purpose of the being within Lavos' shell, just that it was created from a culmination of all genetic data from the planet.
I think to fully understand it's purpose, we'd have to know just where the Lavos creature originated from. (Don't just say "space") From what we know they land on planets, cultivate genetic data into their being, create spawn asexually (presumably clones of the genetically evolved mother) who travel to other planets (somehow) to repeat the process.
Presumably the Lavos on earth came from a similar situation, a planet that likey died eons ago from its own Lavos parasite, but where did that come from? Where was the first parasite in this chain of planet devouring ever evolving creatures originate? How and why was it created? Was it a naturally evolving creature that became able to enhance its own features, spreading to different planets until they became the destructive parasites we know? Or was it some mad alien scientist who dreamed of creating the perfect being ala Cell?
Definitely a lot to ponder and speculate on.