There are a number of reasons why a snail may leave its tank. One of them is that the conditions in the tank may not be providing everything they need, so they set out to find something better. They have no way to know that the only water source for them is inside of your tank. In a natural habitat, when things aren't just right, they simply move on.
Another reason may be spawning. They may be seeking proper conditions to spawn, and your tank maybe doesn't offer that. Have you tried lowering your water level in the tank by a couple of inches? Some species of snail such as mystery snails and apple snails need to lay their eggs out of water where it is constantly moist/damp but not submerged.
Check your water temp. Again we go back to conditions that may not be optimal for what they need/desire.
Are they getting enough of the right foods? Snails will often travel in search of a better or more ample food supply.
How many different snail species are in your tank? Not all species of snail are compatible. It could also be that your snails are trying to get away from each other. Try watching for behavior changes after the lights go out, also. Most animals have different behavior patterns and habits after dark... Give them 30 - 40 minutes after lights out and sit near the tank and just observe their behavior. Do they become more active? Do any of them become more aggressive towards others? Do they all try to attack the same food source and there isn't enough room/territory to share? enough supply to share peacefully?
Lots of possible reasons, these are the first ones I would be investigating.