How can diabetic ketoacidosis (w/ metabolic acidosis) causes respiratory failure?

Due to acidosis.,, The metabolic acidosis causes a respiratory compensation in an attempt by the body to keep the blood ph normal. The respiratory compensation is to increase minute ventilation (both respiratory rate and volume per breath!). So, the person with severe metabolic acidosis will be breathing fast and deeply. Doing this for an extended period of time can lead to fatigue resulting in respiratory failure.
See below. When you have extreme metabolic acidosis, the body compensates by breathing faster to blow off carbon dioxide (acid) and restore the normal ph/metabolic balance. Then, it usually gets tired and gets into respiratory failure because of that.
See below. Patients with DKA get extremely dehydrated and this can lead to cardiovascular collapse and respiratory failure plus the severe electrolyte disturbances can affect cardiac function and cause other issues that eventually can culminate in respiratory failure and death.
It complicated. The short answer is that while acids build up in your blood stream from the ketoacidosis. Your respiratory system tries to combat this (or neutralize it) by getting rid of co2 (carbon dioxide) --that is, causing a respiratory alkalosis. Eventually it becomes hard to keep up hyperventilating and the body "poops out" and you go into respiratory failure, usually from fatigue.