It’s more due to engineering. Materials have limited strength. Stone has fairly good compressive strength, but it’ll still crack if you put too much weight on it. If you use your stone to make a tower, it won’t get very high before it topples over. If you instead build a pyramid, the weight of the stone on top is dispersed across several stones below it and those stones disperse their weight to multiple stones and so on down to the base, letting you build far taller.
if you build a literal tower there are two primary issues: how do you get things up to the top, and 2, it will fall over because of gravity and or wind if you aren’t careful. (or just the ground being too soft to support it)
the pyramid solves basically all of these problems.