Erectile dysfunction (not getting an erection ) has physical as well as psychological reasons. If you are experiencing spontaneous erections or morning erections then your problem is more likely to be psychological. You should consult psychiatrist or urologist for final diagnosis.