Sand cools down faster than water because it has a lower specific heat capacity than water. That is, it takes more energy to raise the temperature of water than to raise the temperature of sand by the same amount, given equal masses of each substance. Sand has a specific heat capacity of about 0.290 J/g°C, while water has a specific heat capacity of 4.18 J/g°C.
The specific heat capacity represents the amount of energy, in joules, that it takes to raise the temperature of one gram of a given substance by one degree Celsius. Put more simply, the amount of energy it takes to raise a quantity of water by one degree Celsius would raise an equivalent quantity of sand by a little over 14 degrees. Likewise, sand does not need to lose nearly as much energy as water to produce equivalent cooling. Since it "holds" a lot less energy, it cools down much faster than sand.
Indeed, liquid water has an unusually high specific heat capacity. Because it is much less prone to temperature swings than other common substances, large bodies of water often work to moderate temperatures in a region. This helps to explain, for example, why average temperatures fluctuate very little over the year in San Francisco, a city whose climate is heavily influenced by the water that nearly surrounds it.