Yeah it happens when the sand is really dry. You can even get it going to a certain extent by running on the sand. Not that I like running. Just part of how cool beaches are.
Here's what wiki has to say on the matter:
"On some beaches around the world, dry sand will make a singing, squeaking, whistling, or barking sound if a person scuffs or shuffles their feet with sufficient force.[2][3] The phenomenon is not completely understood scientifically, but it has been found that quartz sand will do this if the grains are very well-rounded and highly spherical.[4] It is believed by some that the sand grains must be of similar size, so the sand must be well sorted by the actions of wind and waves, and that the grains should be close to spherical and have dust-, pollution-, and organic-matter-free surfaces. The "singing" sound is then believed to be produced by shear as each layer of sand grains slides over the layer beneath it. The similarity in size, the uniformity, and the cleanness mean that grains move up and down in unison over the layer of grains below them. Even small amounts of pollution on the sand grains reduces the friction enough to silence the sand.[3]
Others believe that the sound is produced by the friction of grain against grain that have been coated with dried salt, in a way that is analogous to the way that the rosin on the bow produces sounds from a violin string. It has also been speculated that thin layers of gas trapped and released between the grains act as "percussive cushions" capable of vibration, and so produce the tones heard.
Not all sands sing, whistle or bark alike. The sounds heard have a wide frequency range that can be different for each patch of sand. Fine sands, where individual grains are barely visible to the naked eye, produce only a poor, weak sounding bark. Medium-sized grains can emit a range of sounds, from a faint squeak or a high-pitched sound, to the best and loudest barks when scuffed enthusiastically.
Water also influences the effect. Wet sands are usually silent because the grains stick together instead of sliding past each other, but small amounts of water can actually raise the pitch of the sounds produced. The most common part of the beach on which to hear singing sand is the dry upper beach above the normal high tide line, but singing has been reported on the lower beach near the low tide line as well."