Epidemics are dangerous and difficult to prevent and control, especially in urban areas. Clarifying the correlation between the COVID-19 Outbreak Frequency and the urban spatial environment may help improve cities’ ability to respond to such public health emergencies. In this study, we firstly analyzed the spatial distribution characteristics of COVID-19 Outbreak Frequency by correlating the geographic locations of COVID-19 epidemic-affected neighborhoods in the city of Beijing with the time point of onset. Secondly, we created a geographically weighted regression model combining the COVID-19 Outbreak Frequency with the external spatial environmental elements of the city. Thirdly, different grades of epidemic-affected neighborhoods in the study area were classified according to the clustering analysis results. Finally, the correlation between the COVID-19 Outbreak Frequency and the internal spatial environmental elements of different grades of neighborhoods was investigated using a binomial logistic regression model. The study yielded the following results. (i) Epidemic outbreak frequency was evidently correlated with the urban external spatial environment, among building density, volume ratio, density of commercial facilities, density of service facilities, and density of transportation facilities were positively correlated with COVID-19 Outbreak Frequency, while water and greenery coverage was negatively correlated with it. (ii) The correlation between COVID-19 Outbreak Frequency and the internal spatial environmental elements of neighborhoods of different grades differed. House price and the number of households were positively correlated with the COVID-19 Outbreak Frequency in low-end neighborhoods, while the number of households was positively correlated with the COVID-19 Outbreak Frequency in mid-end neighborhoods. In order to achieve spatial justice, society should strive to address the inequality phenomena of income gaps and residential differentiation, and promote fair distribution of spatial environments.