Sometimes, patients would report erectile dysfunction as a part of the symptoms of prostate cancer, but it is not common, and it would only be seen in really serious conditions. When cancer progresses, it starts losing the characteristics of healthy tissue. The cells become aberrant and hyperactive, and would gradually start losing the common limitations of the normal tissue.
The prostate has a surrounding capsule, and no benign growth would go further. The prostate might be very enlarged, but there will be clear limits of prostate tissue and the surrounding area. That does not happen with cancer, and tumor cells would trespass those barriers and slowly migrate to surrounding organs and tissues.
Erectile dysfunction as a result of prostate cancer would arise in the event of a tumor invasion to the corpus cavernosum, the structures in the penis that would fill with blood to increase the size and rigidity of the penis during an erection.