I've been wondering about that myself. The problem is that it seems to appear in snakes that have nothing really in common with each other as far as habits go. Both our adders and grass snakes have keeled scales. One thrives in dry areas and eats lizards and rodents (although it is pretty active for a viperid), the other is very much like a garter in its lifestyle, is usually found near water and feeds on fish and amphibians. I just use these two as examples, because they have so very little in common. They have different lifestyles and are not closely related and not all colubrids and viperids have keeled scales. But I don't see debris getting stuck between the scales on those that don't.

But what do keeled scales do? They at least increase the surface area of the scale and the whole snake. They would cool down faster, but also possibly heat up quicker. Keels might improve grip, if they weren't specifically dorsal scales and thus not usually in contact with anything, unless the snake is swimming, but not all snakes that have them swim regularly. The keeled scales could at least in theory improve the camouflage of snakes, more specifically diurnal ones, but then again, not all diurnal snakes have them, either.

If anybody can come up with an explanation that doesn't involve the supernatural, I'd be interested in hearing it.