The chemical reactions and pathways resulting in the formation of peptidoglycans, any of a class of glycoconjugates found in bacterial cell walls.