It depends on who you ask, or what you read. I've read that they were strictly for religious purposes, that they were used to store grain, that they were used to entomb priests and kings, and the Gods lived in them,
I thought they were in line with the stars on Orion's belt, from where their gods descended, including Sirius, hence Osirius and Isis, and where souls went after death (the Duat). Hieroglyphs in the tomb of Thutmose III, state "Whoever shall make a copy of the Duat, and shall know it upon the earth, it shall act as a magical protector for him both in heaven and in earth. unfailingly, regularly and eternally." Within the galaxy we exist closest to Orion's sword/phallus, the most generative place for making stars. The pyramids of Giza are also said to be in line with the ancient city of Heliopolis, where Plato, and Pythagoras and other philosophers journeyed and became part of the ancient Egyptian mystery schools and spread them in the West. The only thing left standing in that part of the ancient cities was the obelisk. Of course Washington also has an obelisk in the Washington Monument, which sits inside the Vesica Pisces.