I read in a lot of places that for some reason the moon lacks carbonates, and thus carbon. Part of the reason seems to be the lack of biological origin and cycles. But are there no other sources for getting carbon on the moon if the need arises?
There is a lot of carbon in the solar system without biological origin. Carbonaceous chondrites make up about 5% of meteorite falls. Astronomers have matched the spectral signature of asteroids to c chondrites. There are several categories but they look like coal. These contain plant nutrients and plants have been grown in them. https://www.newscientist.com/article/mg22430004-900-asteroid-soil-could-fertilise-farms-in-space/ So if this kind of thing exists on the moon, it would be great for colonists.
If you accept the theory that the Moon was created out of a collision with the early Earth, then the significant heating during that event would have baked most of the volatiles (water, carbon) out of the coalescing Moon. IIRC carbonate minerals are a result of leaching rocks with water with dissolved CO2 (carbonic acid), both of which would likely be absent per theory.
Carbonate rock like limestone is formed primarily from skeletal remains of marine animals like corals and molluscs and involves sedimentation under water. Other carbonate minerals can be formed by metamorphic processes (marble) and evaporative crystalisation of dissolved carbonate minerals (tufa/travertine) - from carbonate derived from pre-existing carbonate rocks. It is not expected to be present on The Moon because of the absence of carbonate forming organisms and water/atmosphere.
Materials containing carbon with non-life origins should exist on the moon such as primordal or infalling carbonaceous chondrite material.