Desolation Moon isn't damaged, it is incomplete. So your construction ship isn't repairing it, it is constructing or completing the construction of it. That is a different concept.
When given a repair order, a construction ship will move straight to the damaged ship and begin work immediately.
When given a construct order, a construction ship will always begin by visiting the nearest star port in order to top up it's store of resources (the building blocks of construction) and then it will move to the construction site and (normally) begin the construction work.
my construction ship looks at the moon, and then warps back to one of my star ports
I assume that your construction ship began in the same system as Desolation Moon when you gave it the order to work on it, so starting by visiting a star port is normal behavior as detailed above.
Then they come back, look at it and warp back again.
I am not sure what is happening here. Perhaps the next stage of construction requires a particular resource that wasn't available at the star port. I suggest cancelling the order to work on Desolation Moon and then order a different construction ship, perhaps one located close to your home planet, which should be well stocked with resources, to do the work instead.