The primary function of calicoblasts is to secrete calcium carbonate in the form of aragonite or calcite, which are the two main mineral forms found in coral skeletons. This secretion process helps in the continual growth and repair of the coral exoskeleton, providing structural integrity and protection against physical damage and predation.