First off, I hope this question is not too offensive. Discussing technicalities of a genocide will certainly disgust some. I am in no way trying to condone nazi crimes. I am also not sure whether it makes sense to search for rational thought in genocide. Here goes anyway:
Nazi death camps used shower heads to introduce a gas into the gas chambers, thereby killing people. The gas used was Zyklon-B, an industrial product produced by a single supplier, and likely relatively expensive. It also meant that the gas chambers had to be aerated for a number of minutes before soldiers or forced laborers could enter the gas chambers to drag out the corpses.
Why didn't they simply use CO2? It's a byproduct of basically any fire. It's cheap and could have been produced on-site trivially. It's also part of normal air and only toxic in high concentrations, likely meaning less danger to soldiers.
They did sort of use CO2/CO in the earlier days, in the form of poorly maintained van trucks that would drive around the camps with their exhaust piped directly into the back of the van. That was slow and inefficient though, as the truck had to run long enough to actively displace all the oxygen within the volume of the van.
Zyklon B from its Wikipedia page was intended as a pesticide so there was already a large industrial supply lying around. It works on a cellular level and will cause widespread cell death within 2 minutes of inhalation at extremely low concentrations, making it ultimately much faster with less maintenance.
I'm not a historical expert, but the deaths caused by Zyklon B are also described to be much, much more violent than simply passing out from oxygen deprivation- and I could posit that the Nazis, viewing jews et al. as not human, would have preferred such a death for them.