I think this is because your shoes have tracks over the non-uniform surface to provide frictional force for movement,these holes allow the wet sands take longer time to evaporate, the outermost layer should get evaporate first, and fall off once the water is evaporated.If your shoe surface is facing directly downward, It would probably take a very long time for all the sand to fall off before you use the shoes again.
NB , the inner layer would take longer time to evaporate .
As the amount of sand slowly falls off, the reason why there are still some of them adhered to the shoes is because the tracks under the shoes are non-uniform and provide a normal reaction in a microscopic level, balancing the pull of gravity.
The reason why they remained stuck there is because the weight of these inner layers of sands are less "heavier" as there are no sands sitting above it, and the normal force provided by the tracks is enough to balance the gravity of each grain of sand By F = dm * g allowing them to stuck there ; dm is infinitesimally small mass.