Corals are not soggy green weeds. They are colonial hydrozoan cnidarians. They do indeed have bodies made of calcium, and when they die, other coral polyps grow on top of the calcium skeletons left behind, thus forming a reef.
Most corals also have associated algae, which provide the coral hydrozoans with photosynthate as food.