A German study found that 69% of men involved in a sleep apnea study also suffered from ED. Disruptions to breathing during sleep affect oxygen levels in the blood, which can cause problems generating an erection. Lack of sleep also disrupts hormone production.