To build a tomb. Not a shrine, not a place of worship, not a functional structure. Not something that could be repaired or repurposed. A tomb and nothing else.
A purposeless pyramid would get bogged down with plumbing and fountains and extra passageways and observation decks and on and on and on. It would have been impossible to build.
> extra passageways
They 100% had these.
There seems to be a yet-explored "big void" in the Pyramid of Gaza, found using "Muon tomography":
https://en.wikipedia.org/wiki/ScanPyramids#ScanPyramids_Big_...
https://en.wikipedia.org/wiki/Muon_tomography
i mean there where usually temples around it with cults