You are right.
Erection of penis has many factors. Psychic stimulation due to erotic material or thought activates certain nerve cells in brain, these nerve cells send signal to
spinal cord and ultimately reach at penis. The penis has two types of nerve supply:- somatic and autonomic nerves.
The somatic nerves are of two types :- Sensory(necessary for sensation like touch, pain, temperature etc) and Motor (necessary for
muscle contraction).
The autonomic nerves are also of two kinds:- parasympathetic nerves of sacral segment origin (that is from lowermost part of spinal cord) and sympathetic nerves of thoracolumbar origin (that is from middle part of spinal cord). The parasympathetic stimulation results in the formation of the erection, while the sympathetic stimulation is involved in ejaculation.
Spinal cord ends at the level of L1
vertebral body. Any
injury below L1 Vertebrum like prolapse inter-vertebral disc, while not pressing on the spinal cord, can compress a nerve roots carrying parasympathetic supply. This compression of roots may lead to sciatic pain or
motor dysfunction, as well as
Erectile Dysfunction in male because of compromised para sympathetic supply.
Latest study have proven that even after damage to spinal cord some amount of nerve stimulation from brain may reach up to penile tissue but with lesser parasympathetic component and thus resulting in very poor and ill-sustained erection as happening in your case.
Better control of
disc prolapse may revert the symptoms.