Because a stone and a grain of sand are solids, and water is a liquid — and the difference lies entirely in how strongly their constituent particles are held together.
Inside every stone and every grain of sand the particles are closely packed and the interparticle attractions are very strong. They hold each particle in a fixed position, so a grain keeps its own definite shape and can sit still on the grains below it without collapsing. Grain rests on grain, and the heap stands.
In water the interparticle attractions are much weaker. The particles are free to move past one another, so no layer of water can hold up the layer above it. The moment you try to heap water, the particles at the bottom simply slide sideways, and the water spreads out until its surface is level.