The stability of Earth's climate on geological timescales is enabled by the carbon-silicate cycle that acts as a negative feedback mechanism stabilizing surface temperatures via the intake and outgassing of atmospheric carbon. On Earth, this thermostat is enabled by plate tectonics that sequesters outgassed CO2 back into the mantle via weathering and subduction at convergent margins. Here we propose a separate tectonic mechanism-vertical recycling-that can serve as the vehicle for CO2 outgassing and sequestration over long timescales. The mechanism requires continuous tidal heating, which makes it particularly relevant to planets in the habitable zone of M stars. Dynamical models of this vertical recycling scenario and stability analysis show that temperate climates stable over timescales of billions of years are realized for a variety of initial conditions, even as the M star dims over time. The magnitude of equilibrium surface temperatures depends on the interplay of sea weathering and outgassing, which in turn depends on planetary carbon content, so that planets with lower carbon budgets are favored for temperate conditions. The habitability of planets such as found in the Trappist-1 system may be rooted in tidally driven tectonics.