Sand is a poor conductor of heat so when the Sun warms the sand, the heat is not distributed evenly, making the surface hot. Also the specific heat of sand is lower than that of water so when both are exposed to the same amount of light, the sand at the surface will have a higher change in temperature.