During ejaculation, semen is passed through the same tube as urine, but the body prevents the two liquids from ever coming into contact.
As the erection begins, a cleansing liquid is released from the penis, which lubricates and removes any traces of sperm-harming acid which may be left behind after urination.
Next, the bladder is physically locked, making it impossible to urinate during an erection. The two acts are never normally confused, unless the body’s physiology has been changed, following a prostate operation for example.