Strengthening the construction of ecological civilization is an inevitable requirement for promoting high-quality economic and social development. It is of great significance to study the evolutionary trend and relationship between urban spatial structure and ecological efficiency to promote high-quality social development. Taking Shandong Province as an example, this paper obtains data on urban factors such as points of interest, night light, number of employed people at the end of the year and water supply; uses Anselin Local Moran’s I index to identify urban centers; analyzes the distribution form characteristics and agglomeration degree of urban space; and studies the spatial distribution characteristics and causes of differences in ecological efficiency based on the Super-SBM DEA model with undesirable output. The results show that all cities in Shandong Province show an inverse S-shaped circle decreasing trend, Laiwu city has the highest compactness (compactness index is 2.96), and Tai ‘an city has the lowest compactness index of 0.04. The level of eco-efficiency in Shandong Province is “low in the west and high in the east”, and the difference in eco-efficiency between regions is increasing year by year. Urban compactness has a “first increasing and then decreasing” effect on eco-efficiency. Technological innovation and industrial structure narrow the spatial difference in eco-efficiency, and the level of economic development expands it to a certain extent. This study aims to fill the gaps in existing research. By analyzing data on the evolution of urban spatial structure and resource consumption, it will reveal the trends of changes in the urban spatial structure of Shandong Province and study the impact of these changes on ecological benefits.