What does inflammation have to do with erectile dysfunction? Possibly everything according to some experts. Probably the most foundational aspect of an erection is endothelial health and, it turns out, endothelial health has everything to do with inflammation (or the lack thereof). In fact, one study found that ALL of the following inflammmatory markers were associated with erectile dysfunction: 
This list could continue, but the important point is that inflammation hammers the endothelium, the lining of your afteries and blood vessels, which then hammers your erections. This has caused some researcher to believe that inflammation is the true root of most erectile dysfunction. 
There are other indictions that this could be the case. infections with Chlamydia pneumoniae or cytomegalovirus have been associated with erectile dysfunction as indicated by increased inflammatory markers.  The same has held true for gum disease as well. 
So how does chronic inflammation affect the endothelium in such a negative manner? First of all, it lowers nitric oxide availablity. This has been observed in several populations, one of the most notable being apnea sufferers, who have elevated inflammation for chronic sleep interruptions.  One of the ways inflammation controls nitric oxide is by affecting eNOS, the stuff of Viagra.  Yes, inflammation is the ultimate anti-Viagra in this sense.
Affecting NOS negatively is potentially dangerous in the long term as well, because nitric oxide decreases the damage done to arterial walls. So as chronic inflammation turns off your nitric oxide, additional damage occurs to the endothelium, which in turn leads to decreased nitric oxide and so on.
The bottom line: to avoid erectile dysfunction, you have to get this Enemy #1 in control. Remember, this will also decrease your cancer and cardiovascular risks as well. Read my links on How to Decrease Inflammation and Juicing and Inflammation for starters.
1) European Heart Journal (2006) 27, 2640â€“2648, "Unfavourable endothelial and in?ammatory state in erectile dysfunction patients with or without coronary artery disease"
2) Eur Heart J, 2007, "Is erectile dysfunction a low-grade systemic inflammatory condition?"
3) Eur J Clin Invest, 2006 Jul, 36(7):497-502, "Infection induced inflammation is associated with erectile dysfunction in men with diabetes"
5) Circulation, 2008, 117: 2270-2278, "Inflammation, Oxidative Stress, and Repair Capacity of the Vascular Endothelium in Obstructive Sleep Apnea"
6) ENDOTHELIAL DYSFUNCTION AND INFLAMMATION, Progress in Inflammation Research, 2010, 65-80, "Post-translational regulation of eNOS activity in inflammation"