I don't know of anything that can improve erectile dysfunction as much as exercise with the exception of Eating the Right Foods. Exercise turns back the clock: some of you will find it's literally a fountain of youth, especially for your sex life.
First of all, let's start with an intuitive concept: exercise improves blood flow. Let me say that again in case you didn t catch the significance of it: exercise improves blood flow. And if you're male, blood flow is what it's all about when it comes to erectile dysfunction.
In fact, I would go so far as to write a simple formula: Exercise=Viagra. Yes, exercise has been shown to so signficiantly improve erectile dysfunction so that it has been compared to that blockbuster impotence drug. Sound like an exaggeration? Fitness Rx reported that "German scientists, in a paper presented at the European Association of Uruology Annual Meeting, found that putting men with erection problems on an exercise program was just as effective for improving erection capacity as taking Viagra."  And recently Hong Kong researchers reviewed seven previously published studies and verified that "moderate and high physical activities were associated with a lower risk of ED [Erectile Dysfunction]". 
Think of the significance of this. Viagra, Cialis and Levitra have been hailed as miracle cures for middle and senior aged men, when, in fact, the underlying root cause of their erectile dysfunction is often lack of exercise. Why is exercise so critical to sexual health? The reason is that your blood vessels are lined with delicate circulatory tisse called the endothelium. And guess what appendage of yours is all about having a healthy endothelium? That s right good erections depend on a good endothelium and a good endothelium depends on good exercise and diet of course.
"Why?" you ask. Well, there are many reasons. But #1 is probably that exercise increases Nitric Oxide , the all-important chemical which relaxes blood vessels throughout your body including the penis. (Nitric Oxide is very heart-protective as well.) Viagra/Cialis/Levitra work on Nitric Oxide for this reason - actually the enzyme (nitric oxide synthase) that breaks down nitric oxide - and relax the blood vessels that allow blood flow into the penis.
Exercise seems to raise nitric oxide levels primarily by increasing the bioavailability of eNOS.  Yes, that is the same enzyme that Viagra works on! Again, this is why Exercise=Viagra, except without all the nasty, toxic side effects. And the beauty of exercise is that it works in men with normal or high blood pressure, old and young - everyone! 
And it does something that Viagra and Cialis can never do: vascular remodeling. This term refers to the fact that exercise.literally rebuilds small veins and capillaries throughout your body. Vascular tissues are literally rebuilt throughout your body when you get active.
Does this include the penis? You bet it does! Exercise increases the "number and diameter of blood vessels" throughout the body and that is going to be good news below the belt. 
And exercise isn't going to just help your erections in the short term - it will help long term as well. One study examined combining a Low Fat Diet with exercise. The results were dramatic. Besides increased blood flow, which is always great for erections, the participants also experienced an average 16% drop in blood pressure, a 17% drop in cholesterol, a 19% drop in LDL and a 20% drop in triglycerides.  These represent large drops in some of the most important risk factors for cardiovascular disease. That means that, on top of all the new Nitric Oxide your body is pumping out, the exercise and low fat diet were protecting the delicate veins and arteries supplying the penis.
This study points out something else important: exercise protects you from and improves any existing erectile dysfunction both in the short term, through improved blood flow and increased nitric oxide, and in the long term by protecting your entire cardiovascular system. Many studies have shown that exercise drops triglycerides and blood pressure and both of these are key risk factors for erectile dysfunction. (The drop in total cholesterol and LDL was likely due to the Low Fat Diet for the most part.)
What if you have been overly sedentary and eaten poorly most of your life? Is there hope. One study points out that "the CHD risk factors measured in mid-life, including age, current cigarette smoking, obesity, hypercholesterolemia, and hypertriglyceridemia, were associated with incident ED 25 years later."  In other words, the authors point out that you have over two decades to catch the problem before erectile dysfunction lurks at the door and eventually comes knocking. So start now with exercising - don't put it off!
One study found that exercise improved erectile dysfunction in obese men, one of the hardest-to-treat groups.  (For more information as to how and how much exercise increases nitric oxide leves, see my link on Exercise and Nitric Oxide.
Exercise also raises HDL, the good cholesterol.  HDL is, generally speaking, known for its remarkable ability to "clean up" your arteries and protect them from artery-damaging plaque. You want plaque-free arteries for maximum endothelial performance and minimal erectile dysfunction. HDL also is a strong booster of nitric oxide and so it helps both short and long term with erectile dysfunction as well.
Is erectile dysfunction always related to poor blood flow and the endothelium? Not always actually - low testosterone can play a vital role as well. Healthy testosterone levels are critical to the penile muscles that trap blood for maintaining erections. As you might have guessed, one form of exercise, weight lifting, has been found to raise testosterone in several studies. Read this link on How Weight Lifting Can Increase Testosterone for more details.
Again, generally erectile dysfunction in middle age and beyond is nitric oxide and blood flow related, but low testosterone can definitely be a root cause as well. One thing that can help those penile mucles and improve erectile dysfunction directly are Kegels, which are essentially exercise for the penile mucles that need to powerfully contract for erection. It may sound strange to exercise muscles in the groin area, but it is an effective and research-backed way to improve erectile dysfunction.
The bottom line is that exercise will greatly improve and likely cure your erectile dysfunction, especially if coupled with proper diet as well. (Always talk to your doc of course.)
1) Fitness Rx 7/05, p.192.
2) Intl Jour Impot Res (2007) 19, 245 252
3) J Appl Physiol,1997,82:760 64
4) Jour Appl Physio, 2007, 203:432-442;Experimental Biol and Med,2003,228:434-440;Archives Intern Med,2007,167:999-1008
5) J Am Coll Cardiol,1987,10:321-326
6) J Am Coll Cardiol, 2004, 43:1405-1411, "Heart disease risk factors predict erectile dysfunction 25 years later"
7) Circulation, 1999, 100:1194-1202, "Regular Aerobic Exercise Augments Endothelium-Dependent Vascular Relaxation in Normotensive As Well As Hypertensive Subjects"
8) Circulation, 2000, 101:2896-2901, "Physical Activity Prevents Age-Related Impairment in Nitric Oxide Availability in Elderly Athletes"
9) J Sex Med, 2008 Mar, 5(3):552 561, "Low-Fat Diet and Exercise Preserve eNOS Regulation and Endothelial Function in the Penis of Early Atherosclerotic Pigs: A Molecular Analysis"
10) JAMA, 2004, 291(24):2978-2984, "Effect of Lifestyle Changes on Erectile Dysfunction in Obese Men A Randomized Controlled Trial"
25) Circulation, 1995, 92:197-204