There is no basis for the statement your doctor has made. Penis will get hard due to blood supply and not with sperm. There is lot of difference b/w the 2. So if you are not able to get a good erection it is termed as Erectile Dysfunction. Hence you should be consulting a Urologist to get some help with this issue.