There are multiple reasons. For the TL;DR people very quickly described: less risk for side effects related the testicles, health, cancer, impregnating chance 2-6 weeks after surgery, hormone based behavior changes are basically one of - if not
the - reason for selecting it (and recommending it from vets side). Combined with full ignorance towards the negative results, which are quite often given to some degree.
If you want to read a bit further:
The most comical aspect: It is still possible that there could be sperms in "front" of the cut, so there is a very, very small chance for a successful impregnation shortly (2-6 weeks on humans, on dogs no idea) after the surgical process. But no, that's none of the vets reasons.
One reason is: the behavior changes through (very early, in most cases) spaying / ovariohysterectomy or neutering / castration is
highly wished for. Not only by the owners but also by many vets which assume that it is "easier" or "stress-free" for the animal to be reduced into an oversized sex-less teddy bear without normal natural sexual cycles and hormonal reaction.
Animal "protection" groups and dog trainers are as well playing a role because it's recommended to tell the owners about the possible
positive outcomes which are neither guaranteed nor do they often tell the owners about a whole bunch of negative, almost guaranteed results.
Very young female dogs which get ovariohysterectomy will not develop cancer in the mammary glands / ducs as often, it will get highly reduced in risk. Surely enough a removed uterus can't develop tumors as well..
The animals also tend to be more puppy-like in behavior, not marking, less odor, no sexual striving. As they never learned about their natural sexual behavior from hormonal changes and
ways too much owners in reality don't want animals as pets which behave naturally, including sexual striving, this is also some recommended and "wished for" outcome. It also works for male dogs to a degree (less territorial guarding, less fights about other dogs (females mostly) and so on).
All those aspect don't count for vasectomy or ovariectomy (even less for leaving them in and just parting the connection which is possible, but very rare with dogs), as the hormones will mostly stay in place and the dogs grow into young dog / "teen" and then mature developments of the reproductive organs. Which might result in cancer some time later in life, some breeds more often, some less often.
But who would accept the removal of his lungs, liver and heart to prevent lung, liver and heart tumors?
Why is it important to reduce a risk by taking away a whole part of normalcy for those animals. You won't get this thought into the mind of those who suggest neutering or spaying. No matter the logical argumentation.
Some disadvantages of neutering / spaying include:
irregular, round-the-year fur growth
irregular fur loosening
irregular behavior in packs with dogs of same or different sex (which can result in less aggression but also less acceptance, both is possible)
less liveliness, more of a depressed state
loss of appetite
fat growing (getting mass even eating the same amount)
risk for heart or organ failures in higher age (missing protective hormones, mostly female dogs)
incontinence (quite often and mostly for the lifetime)
loss of sensual feelings in the area of the surgery
changes in muscle mass or sportive energy levels
changes in behavior, not only positive ones
loss of sexual interest and thriving (surely enough, this is wanted from many owners, less from zoophiles..)
less acceptance of new dogs in the pack in higher age due to no sexual interest feeding curiosity
.. and many more. But like said, for vets the "positive" aspects mostly count more. Spoke about this on an scientific argumentative level with several vets and a good vet friend of mine and you'll hear arguments like: "Your dog is 5/6/7/8/9 years old, if she develops cervical cancer (or if he develops testicle / prostate cancer as example) she/he might be 10-12 and the risks of a surgery in that age are high!".
So lots of "if", "when", "but" as decision pointers on vets, trainers, "protection" groups and so on.. The result of a whole life difference for the animals to get their normative sexual thriving surgically removed gets thrown under the table ways too universally.
TL;DR? I warned you.
English is not my main language, so there might be wording errors.