The earliest reference to waterproof sand is in the 1915 book The Boy Mechanic Book 2 published by Popular Mechanics.  The Boy Mechanic states waterproof sand was invented by East Indian magicians.  The sand was made by mixing heated sand with melted wax.  The wax would repel water when the sand was exposed to water.  
Magic sand was originally developed to trap ocean oil spills near the shore.  This was done by sprinkling magic sand on floating petroleum, which would then mix with the oil and make it heavy enough to sink.  Due to the expense of production, however, it is no longer used for this purpose. 
Hydrophobic sand has also been tested by utility companies in Arctic regions as a foundation for junction boxes, as it never freezes.  It is also used as an aerating medium for potted plants.