Energy consumption in homes produces CO2. In many countries, building regulations are being set to enable energy efficiency performance levels to be issued. In Spain, there is a regulated procedure to certify the energy performance of buildings according to their CO2 emissions. Consequently, some software tools have been designed to simulate buildings, and to obtain their energy consumption and CO2 emissions. In this paper, investment, maintenance and energy consumption costs are calculated for different energy performance levels and for various climatic zones in a single-family home. According to the results, for buildings to be more energy-efficient, higher construction and maintenance costs are implied, which are not compensated by lower energy costs. Therefore under current conditions, economic criteria do not support the improvement of a dwelling's energy efficiency. Among the possible measures to promote energy efficiency, a price for CO2 emissions is suggested, including the social cost in the analysis. For this purpose, the cost-optimal methodology is used. In different scenarios for the discount rate and energy prices, various prices for CO2 are obtained, depending on climatic zone and energy performance level.