What is the role of gills in terrestrial Crustaceans?
Short answer
Gills in terrestrial crabs serve a role in water storage and ion homeostasis.  

Background
Crustaceans are a huge group of species within the phylum of arthropods, including crabs, lobsters, crayfish, shrimp, krill and barnacles. Because of the huge variety of species within the crustaceans, I'll focus this answer on terrestrial crabs.

Air-breathing crabs have universally retained gills, but have also developed accessory breathing organs, usually lungs formed from the inner lining of the gill chamber. Aquatic crabs generally have large gills with very thin closely packed lamellae. Land crabs feature lungs that are well vascularized, have short blood-gas diffusion distances and often have adaptations to increase surface area, all of which greatly increase the diffusing capacity of the respiratory
system (Farreley &amp; Greenaway, 1994). 

In contrast, the gills in land crabs  are reduced in size and in surface area. The epithelium is usually modified for ion transport as indicated by the presence of densely packed mitochondria and relatively long blood/gas diffusion distances. Hence, the gills in land crabs are thought to primarily serve an osmoregulatory role, rather than a gas-exchange function (Farreley &amp; Greenaway, 1994). The gills are thought to be involved in salt and water uptake. Their spongy structure is thought to aid in their function as water storage areas in periods of molting (Edney, 1977).  However, the gills in many species are still capable of gas exchange, although less efficiently than the lungs (Farreley &amp; Greenaway, 1994). 

References
- Edney, Water Balance in Land Arthropods, Zoophys &amp; Ecology, Springer, New York (1977); 9
- Farreley &amp; Greenaway, J Exp Biol (1994); 187: 113–30