Exploring the complex relationship between ecological restoration and economic development is valuable for decision makers to formulate policy for sustainable development. The large-scale environmental restoration program—Grain for Green—was mainly implemented in the Loess Plateau of China to improve the soil retention service. However, whether this world-famous program affects local economic development has not been fully explored. In this study, using the Integrated Valuation of Ecosystem Services and Tradeoffs (InVEST) model and spatializing the gross domestic product (GDP) based on the remotely sensed nightlight data, we explored the tradeoff between environment (i.e., soil retention service) and economy (i.e., GDP) for the Loess Plateau in a spatially explicit way. We found that the soil retention service increased prominently over the past 40 years, especially after implementing the Grain for Green project. Meanwhile, the GDP increased about nine-fold over the past four decades from 4.52 to 40.29 × 107 USD. A win–win situation of soil retention and economic development was achieved in the Loess Plateau of China, particularly in the loess gully and loess hilly gully regions of the Loess Plateau. The win–win situation of soil retention and economic development was as a result of the Grain for Green program, the optimization of industrial structure, and the increase in non-agriculture employment. Compared with previous studies, more spatial information was available for the Loess Plateau in this study, which is more valuable to policymakers.