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 not only use Zyklon B. They also used carbon monoxide from bottles and engine exhaust. But they considered Zyklon B more effective, especially the commandant of Auschwitz. They could just drop the pellets into the chamber, no need to handle large bottles, keep a hose connected, run an engine etc.
This is pure speculation, but I can also imagine that using a pesticide to exterminate Jews and their various other enemies/victims would appeal to Nazis.