The science behind freshwater invertebrates is very interesting.
There are something like 30-odd phyla of invertebrates (i.e., echinoderms, crustaceans, insects, molluscs, etc.). Of these, most are either entirely or primarily marine in distribution.
Molluscs (snails, clams, etc.): over 100,000 species, ~10,000 in freshwater/on land
Crustaceans (crabs, shrimps, etc.): well over 50,000 species, ~5,000 in freshwater/on land
Annelida (earthworms, leeches, etc.): 15,000 species, ~4000 freshwater/on land
Cnidaria (corals, anemones, etc.): 11,000 species, ~3000 freshwater
Echinoderms (starfish, urchins, etc.): 7,000 species, all marine
Sponges: 5,000 species, only 150 in freshwater
Bryozoans (moss animals): 5,000 species, only 50 in freshwater
Almost all of the "minor phyla" -- chaetognaths, brachiopods, comb jellies, etc. -- are marine. The only two phyla I can think of from the top of my head that are predominantly freshwater are the rotifers and the tardigrades, which are both microscopic. The insects are of course a giant phylum and include many freshwater species, while the arachnids are essentially terrestrial with only a few aquatic or marine species.
Anyway, what restricts 20+ phyla to the sea is the osmoconforming thing: they cannot regulate the movement of salt and water in and out of their bodies. Instead, they simply use sea water in the way we use blood or tissue fluid: as the universal "bath" within which their tissues are surrounded.
The story of why a few phyla adapted to freshwater and then the land is interesting. Only two phyla of invertebrates are fully terrestrial in the sense of being independent of ambient moisture; these are the insects and the arachnids. Vertebrates (our phylum) include a mix: amphibians are not fully terrestrial, but reptiles, birds, and mammals are. Molluscs, worms, and crustaceans are like amphibians, and need damp habitats or they dry out, so they are considered only partially adapted to land.
Why so few inverts bothered adapted to freshwater is also interesting, but it seems that basically there was nothing to entice them there. Compared with the sea, freshwaters lack plankton (mostly), so there's much less food.
Another big question is what routes the different land animals took. Insects seem to have started off as freshwater animals, then lived in marshy bogs, and eventually became fully terrestrial. Crustaceans, on the other hand, seem to have gone from the sea to the land and by-passed freshwaters. Many land crabs, for example, live in forests but breed in the sea. Molluscs seem to have done a bit of both, with some terrestrial snails apparently having marine ancestors while others seem to have had freshwater ancestors.
Anyway, as others have said, "nothing in biology makes sense except in the light of evolution". All good stuff!
Cheers,
Neale