Context. Blazars, which include BL Lacs and flat-spectrum radio quasars, represent the brightest persistent extragalactic sources in the high-energy (HE; 10 MeV–100 GeV) and very-high-energy (VHE; E > 100 GeV) γ-ray sky. Due to their almost featureless optical/UV spectra, it is challenging to measure the redshifts of BL Lacs. As a result, about 50% of γ-ray BL Lacs lack a firm measurement of this property, which is fundamental for population studies, indirect estimates of the extragalactic background light, and fundamental physics probes (e.g., searches for Lorentz-invariance violation or axion-like particles). Aims. This paper is the third in a series of papers aimed at determining the redshift of a sample of blazars selected as prime targets for future observations with the next generation, ground-based VHE γ-ray astronomy observatory, Cherenkov Telescope Array Observatory (CTAO). The accurate determination of the redshift of these objects is an important aid in source selection and planning of future CTAO observations. Methods. Promising targets were selected following a sample selection obtained with Monte Carlo simulations of CTAO observations. The selected targets were expected to be detectable with CTAO in observations of 30 h or less. We performed deep spectroscopic observations of 41 of these blazars using the Keck II, Lick, SALT, GTC, and ESO/VLT telescopes. We carefully searched for spectral lines in the spectra and whenever features of the host galaxy were detected, we attempted to model the properties of the host galaxy. The magnitudes of the targets at the time of the observations were also compared to their long-term light curves. Results. Spectra from 24 objects display spectral features or a high signal-to-noise ratio (S/N). From these, 12 spectroscopic redshifts were determined, ranging from 0.2223 to 0.7018. Furthermore, 1 tentative redshift (0.6622) and 2 redshift lower limits at z > 0.6185 and z > 0.6347 were obtained. The other 9 BL Lacs showed featureless spectra, despite the high S/N (≥100) observations. Our comparisons with long-term optical light curves tentatively suggest that redshift measurements are more straightforward during an optical low state of the active galactic nucleus. Overall, we have determined 37 redshifts and 6 spectroscopic lower limits as part of our programme thus far.