The vagina is a dead end, with a tiny opening at the far end for the sperm to swim up the cervix into the uterus. The semen is the river that carries the sperm, the sperm are tiny little fish in it. The little sperm swim on up into the cervix, and the river of semen turns around and comes back out, usually with gravity (when you're walking around) or just flowing back out after sex. But the little swimmers are way up there by the time the semen leaves.
What goes in must come out. What actually comes out is just the ejaculatory fluid, the semen is already deposited where it needs to be.