Having achieved grid parity, photovoltaic (PV) self-consumption will play a key role in the transition to a low-carbon energy system. Spain, whilst among the EU countries with highest solar irradiation, has recently passed one of the most restrictive self-consumption regulations. We study the implications of this regulation in comparison with alternatives (net metering, net billing) on the profitability (internal rate of return) of potential residential, commercial and industrial investors, as well as the impact of PV self-consumption on government revenues and the electricity system. We find that this regulation hinders the diffusion of PV self-consumption applications by making them economically infeasible. It also creates inefficient disincentives for demand-side adjustment and by fostering disconnection from the grid. Under the current conditions, the direct economic impact of PV self-consumption on both aggregate government and electricity system revenues is positive for investments in the residential segment, negligible for those of the commercial segment and negative for those of the industrial segment. In order to raise compliance with the relevant European Commission guidelines and to promote the diffusion of PV systems at minimum cost to the electricity system, a dynamic net billing scheme is recommended.