Diamond is a very large bandgap material arising high expectations either for optoelectronic applications or for active semiconducting layers in specific electronic devices to be used under extreme conditions of pressure, temperature, wear or radiation, as well as in chemically aggressive environments. Unintentionally boron-doped diamond layers were grown by microwave plasma-assisted chemical vapour deposition (CVD) on {001}-oriented undoped Ib substrates with the addition of oxygen gas during growth. The relative quantities of nitrogen and boron incorporated in the diamond lattice are evaluated by cathodoluminescence (CL) spectra recorded at 5 K. Two different effects are shown to limit nitrogen incorporation: the substrate crystalline quality and the addition of oxygen into the precursor during the growth. First, the CL spectra are shown to change strongly near the edges of the substrate in the regions corresponding to different bulk crystal growth modes. Some regions show a luminescence governed by UV emission while in other regions, where the H3 defect-related luminescence of the substrate is much stronger, the film UV emission is reduced. Second, the relative importance of the free exciton emission with respect to those from the nitrogen-related H3 centre and from the boron-bound exciton is shown to increase with the addition of oxygen during growth. Such observations are of first importance to improve the spectral emission and absorption threshold of the diamond material in the deep UV range.