The design of well spacing significantly influences the sustainability and economic benefit of geothermal energy extraction. However, most studies have predominantly employed heat production-related parameters as indicators of well spacing, and a comprehensive analysis of well spacing design based on an economic model is necessary for practical implementation. In this study, an economic indicator considering the benefits derived from heat production and operating costs is proposed and applied in the Caofeidian, a typical abandoned oilfield in the Bohai Bay Basin. It offers a refined portrayal of directional wells, moving beyond rudimentary representations, to capture their appropriate degree of complexity and behavior in drilling configurations. First, by integrating thermophysical information and site investigation data from previous oil investigations, a heterogeneous 3D model is constructed to forecast the 30-year temperature and pressure evolution. Then, a modified levelized cost of heat (LCOH-HT) is proposed to perform economic analysis in optimizing the well spacing, revealing an optimal range of 300–600 m for the different selected wells. In comparison with results derived solely from heat production considerations, drilling and pumping costs contribute to a 300 m reduction in the optimal well spacing based on the proposed approach, as a larger well spacing leads to increased hydraulic losses and drilling cost, necessitating greater pumping efforts and costs. This finding underscores the need to balance economic and thermal considerations. In addition, we found the difference in the optimal well spacing in space is also caused by the porosity variations. Porosity affects fluid temperature and pressure, leading to changes in the benefits and costs associated with pressure fluctuations. Notably, this novel economic analysis method is not limited to spacing optimization; it can also be used to optimize operating parameters, such as the flow rate, which could provide practical strategies for geothermal energy extraction.