When a city finishes training a unit it ejects them into a tile next to the city. (Seems to always be the same one, though I can't figure out the method it uses to determine the tile.) This can lead to wasted turns while the unit navigates to the nearest road. If you haven't reached the defender limit, you can send the unit back into the city and then navigate it where you want it (or set it to automatically spawn units inside the city).
I think the units should spawn on the a tile with a road out of town. It makes sense in a logical way and from a gameplay perspective.