Apnea literally means "without breath". However, it might just as easily have been name "without sex", because it is so deadly to your sex life and almost always leads to erectile dysfunction. Apnea does not kill instantly like a heart attack or painfully like cancer, but it kills nonetheless, and one of the first signs is usually your libido and erections.
And what would one expect? Apnea repeatedly cuts off your air supply, a condition researchers call hypoxia, throughtout the night. Apnea can cut off the air for as long as ten seconds before the sufferer awakes. In the process, apnea obliterates your sleep pattern and sleep cycles. The disruption of your sleep produces symptoms that you would expect: fatigue, headaches and concentration issues.
Behind the scenes, apnea is silently whacking your testosterone, which often leads to loss of libido and erectile dysfunction. (Read my link Apnea Significantly Decreases Testosterone for more details.) The problem is that testosterone is strongly associated with male libido and erectile strength, because the brain and penile muscles are packed with testosterone receptors. Apnea leads to low testosterone and low testosterone will generally lead to erectile dyfunction.
However, it is not just hormones that apnea attacks: it also decimates your REM cycles and it is during those REM cycles that men get those "morning erections".  Erections during sleep are critical for the health and oxygenation of the penis and, without them, erectile dysfunction is almost a certainty.
Destroying your sleep cycle will also significantly affect your neurotransmitters and make you feel sleepy of course. Anything that leads to fatigue or weariness or loss of alterness invariably affects libido and erectile function. Many drugs, such as antidepressants are a classic example of this: the "relaxation" that they bring also brings the same relaxation to your penis. Apnea is no different: it relaxes your penis and leads to erectile dysfunction.
That's not the end of the story: apnea also decrease NOS (Nitric Oxide Synthase).  Apnea robs you of the enzme that your body uses to make Nitric Oxide, that all important erection-boosting molecule. One animal study showed that tadalafil (Cialis) improved dramatically both erections and testosterone in cases of hypoxia, the state of oxygen deprivation associated with apnea.
All of these factors work together to make apnea a strong and independent risk factor for erectile dysfunction.  In other words, apnea ranks right up there with age, heart disease, high blood pressure (hypertension), prostate surgery and diabetes and other male problems as a cause of erectile dysfunction. Think about what this says: apnea is as hard on your sex life as all these other nasty conditions. It's right alongside major surgery and such relentless killers as diabetes and heart surgery and even old age!
One study found that the more severe the apnea, the more severe the erectile dysfunction. Again, look at what apnea attacks:
Is it any wonder that erectile dysfunction and apnea become one and the same with all of these key items under siege?
Is there any good news in all of this for apnea sufferers? Are those with apnea doomed to a sexless, monastic existence? The studies say otherwise and one study found that one month after initiation of CPAP treatment, 75% had been cured of their erectile dysfunction.  In fact, post-CPAP the researchers found no statistically significant differences in erectile function between the two study groups, one being with the most hypoxia, i.e. breathing disruption and the other with the least. This is even more remarkable considering it was just one month after treatment began.
What if you have severe apnea? Perhaps unexpectedly to some, even those with extreme cases of apnea have very significant improvements in erectile function after CPAP. 
This is very similar to the result we saw in my link on Apnea and Testosterone, where testosterone can be dramatically raised with CPAP and weight loss. For that reason, I would caution that weight loss should also be considered even if the CPAP machine yields good results. So, as usual, sound advice is to get a good doctor and drop those extra pounds.
I also recommend that you read my link on Natural Apnea Solutions. In the last ten years researchers have uncovered the fact that most apnea is actually lifestyle-related and not simple genetics or aging.
1) Journal of Sexual Medicine, 6(11):3147-3157, Published Online: 29 Jun 2009, "Sleep Apnea is an Independent Correlate of Erectile and Sexual Dysfunction"
2) By David Templeton, Pittsburgh Post-Gazette, Wednesday, July 05, 2006, "Men's sleep apnea found alongside erectile problems", http://www.post-gazette.com/pg/06186/703318-114.stm
3) Amer J of Respiratory and Critical Care Med, 2008, 178:644-650, "Erectile Dysfunction in a Murine Model of Sleep Apnea"
4) Sleep Medicine, July 2005, 6(4):333-339, "Erectile dysfunction, obstructive sleep apnea syndrome and nasal CPAP treatment"
5) Intl J of Impotence Res, Advance online publication 26 November 2009, "Erectile dysfunction in severe sleep apnea patients and response to CPAP"