Snakes that live in sandy enviroments have specialy keeled scales and are meant to be there, so the sand wont get up and under the scales and irratate them, like sand boas or some rattle snakes,
but snakes like corn snakes and king snakes dont live on loose sand so there scales arent designed to keep the sand out from under them
sorry if thats not the best explanation, wasnt sure how to better word it,
i hope that helped,