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.
According to Wikipedia, they used a lot of different approaches. Zyklon-B was abundant, as it was used as an insecticide, but was dramatically more poisonous to humans. 4kg of the poison can kill 1000 people. As far as I understand, it proved itself to be the most efficient method for killing a lot of people reliably