I suppose that they were built to provide Pharaohs with respect to his afterlife. And it was a great idea because even now we can see or even touch the monuments from the ancien world.
the Pyramids look absolutely fantastic! To my mind, there're just 2 variants: either it was for a veeeery developed civilization (as it's impossible to build such huge constructions using primitive tools and calculations) or for the UFO or giants who obtained magic or enormous forces accordingly and helped mere people of that time.