I agree that normally it would be a terribly inadequate way of doing things, which is why it was not a hard and fast rule implemente*d in a bunch of places. Nor was Zyklon-B, for that matter, although it was used at Auschwitz and to a far lesser extent at Majdanek.
To understand why they might have used a diesel engine at Treblinka — and I say "might have" because, as already pointed out by someone else, none of the people who testified on this point were experts on engines — you have to consider how gassing came to become a "policy" at six camps in Poland.
Gassing was first used in the T4 euthanasia program in quasi-hosp*ital settings. When it came time for the "Final Solution" in Poland, the shooting of hundreds of thousands of Jews on the eastern front was taking its toll on the soldiers, so alternate means of executive mass numbers of Jews were sought. They tried gassing first at Chelmno in the Wartheland using vans that would pipe exhaust back into the passenger section. This worked, but it was ad hoc and the number that could be killed was limited. Similarly, the use of Zyklon-B at Auschwitz was experiment*al and largely ad hoc. Because there was not great communicat*ion between killing centers, what was tried in one place and worked continued to be used. Ergo, Auschwitz continued to use HCN; Chelmno continued to use CO.
When Treblinka, Sobibor, and Belzec were establishe*d, the staff to install gas chambers there came from the T4 program, so they chose CO. Remember that of thousands of Nazi concentrat*ion camps, only six conducted gassing to any serious extent, which means that while it was a huge program in terms of the number of people killed (~3 million), it was small in terms of the number of places, in comparison to the Einsatzgru*ppen murders (~1.5 million killed), which took place in hundreds of places.
Finally, two important points. This was a secret program, so raising eyebrows was sought to be avoided. Also, there was a war going on, and the war effort itself was going to take precedence in many cases for the best technology*.
That about cover it? Took me five whole minutes to type it out.