Because some of 'em can't swim. Well, that and the fact that many of the snails sold to aquarists live in the intertidal, and eat algae off the rocks at low tide. Those species may climb out and wait for the next high tide, which unfortunately never comes. You'll probably have to punch them off the glass to keep them from committing suicide. Nerites and littorinids are the worst about this, but Turbos and a few other snails will do it to some degree. The latter ones usually return to the water on their own.
Cheers,
Don