The pinacoderm forms an external barrier on the surface and canals of sponges to protect it from the outer environment.