The chemical reactions and pathways resulting in the formation of phosphonates, any organic compound containing one or more C-PO(OH)2 or C-PO(OR)2 (with R=alkyl, aryl) groups. Synthesis of phosphonic acid itself, an inorganic compound without the biochemically relevant C-P bond, is not included.