Efficient space delay-tolerant network (DTN) routing algorithms have been a hot issue in space network-related research. In this paper, for the problems of high algorithm complexity and high network overhead in space DTN routing algorithms, we introduce a node clustering algorithm and satellite node social attributes in the space DTN routing process and design a spatial delay-tolerant network routing algorithm (CD-SDTN) based on node clustering and social attributes. The algorithm designs the social attributes of the satellite nodes based on the connection frequency of the satellite nodes with the ground station and divides the community using the Circle-k-means algorithm. In the routing process, the center satellite node with the highest activity in the community manages the messages received by the satellite nodes located in the community and plans the forwarding of messages within and between communities. Simulation results show that the CD-SDTN routing algorithm has some advantages in terms of delivery rate, average delay and network overhead compared with Epidemic and Prophet, especially when the number of nodes in the satellite network is large.