Problems associated with spinal surgery vary depending on the approach taken (anterior versus posterior), age of the patient, and the presence of comorbidities (other health problems).
With an anterior approach, the incision to get to the spine is along the front of the body. Although this goes through the abdomen and must avoid the organs and large blood vessels, it is less risky than the posterior approach. Entering the spine from the back increases the risk of damage to the spinal cord and subsequent permanent loss of all function (e.g., paralysis, not just sexual dysfunction).
The problem you are describing is called retrograde ejaculation. Instead of propelling the semen forward and out the penis, it goes backwards and into the bladder. Not everyone recovers from this problem. In fact, only about one-third regain complete sexual function.
Various studies report complication rates of retrograde ejaculation anywhere from 1.7 up to 11.6 per cent. Young men should be fully informed about the possibility of this complication with anterior spinal surgery. It sounds like your surgeon has done exactly that!