Living near Lake Erie means that our local news stations often give the warnings for unsafe water conditions for beach goers. It usually happens after a good rain when the water hasn't had time to absorb and dissipate the contaminants like fertilizers that are run off from the land area. So when the bacteria count rises most careful beach goers stay out of the water and take to the sandy shores.
Now however, a study has been made of those warm sandy beaches. Tao Yung of the University of Hawaii who led the study of Hawaiin beaches
concluded that the sandy beach needs to be considered as well in monitoring conditions for public health. It seems the sun that would help to kill off the bacteria doesn't penetrate as well through the sand as it does the water. Therefore the sand may be holding on to its bacteria longer than the water does.
I'm not a germaphobe. I'm a believer in some exposure to build up immunity to some of the stuff lurking in our world that would harm us. I think there was less of a problem with a child's health when we didn't try to shield the child from every potential contact with a germ. So unless there was a sewage runoff at the beach I'd go ahead and dig my feet in the sand. I'd be more afraid of a sand crab than a germ.