Docking bays are required in order for resources to be delivered to a spaceport which is not at a colony, and even standard empires will occasionally acquire one of those.
Spaceport docking bays also appear to be preferred over the colony's docking bays for handling freighter traffic to or from a colony/spaceport pair, so there might be some advantage in cargo transfer rate or docking speed with spaceport docking bays as opposed to colony docking bays. It's also plausible that resource transfers made in a colony's docking bays will not be taxed the way resource transfers made in the docking bays of a station with a commerce center would be, though I have never tried testing to see if that is the case.
Perhaps there are some special situations where a space port might not need them (I can't think of any off-hand)
All colonies currently come with 20 docking bays, which is more than sufficient for freighter traffic and general refueling in most cases, and cargo is shared between the colony and its associated spaceport (and probably the other orbital stations, though I've never checked), so one could argue that most spaceports built over colonies do not require docking bays.
(It used to be that colonies only came with three docking bays, which was rather inadequate for anything more than minor volumes of freighter traffic and so any colony which was expected to see any significant volume of freighter traffic more or less required a spaceport with a decent number of docking bays, but one of the patches in ?Shadows increased that to the current 20. If you're running a version of the game which is sufficiently old to have the smaller number of colonial docking bays, then there is a very clear reason to have a reasonable number of docking bays on your spaceports as freighter traffic going into only three docking bays can become rather badly congested.)