We built a sandcastle of Bayeux Cathedral but as the sand dried, it started to collapse. So why is wet sand a better building material? The answer appears to be surface tension of water. Water molecules pull on each other using small static electric charges. In the middle of a body of water, a molecule is pulled in all directions. On the edge, there is nothing pulling it in the direction of the air so it is pulled more strongly into the water. This results in a tight outer edge making water droplets. This inward pull of water means it can pull sand grains on either side of it inwards. This seems like a good explanation:
http://myqacorner.blogspot.co.uk/2012/03/why-does-damp-sand-hold-shape-of-castle.html