D-amino acids are synthesized by different pathways (as D-alanine, for example, is produced in bacteria directly from pyruvate). Booth by production and utilization, L and D amino-acids are in different metabolic pools, that can be regulated independently. D amino acids are also not targeted by the most of enzymes targeting L-aa.
All natural amino acids that we get are all L form. But many microorganisms specially Gram positive microorganisms make D form of amino acids and incorporate in their cell wall. It gives specila advantage to the microorganism, in that the presence of D-amino acids protects against attack by most peptidases.