It's not just sand. It's soft sand. He probably had to put that sand in a food processor to soften it.
Soft Sand's in game icon shows that it's stored in a bag, that's how the player or Pokemon doesn't drop it all.
It's funny, but this wouldn't actually happen in the game unless the bag is open or tears.