By continuing to fire rockets into Israel, Hezbollah insures that Israeli public opinion will force the Israeli government to keep fighting until Hezbollah is crushed. Israelis aren’t going to tolerate any outcome that allows the Hez at will to force hundreds of thousands of them into bomb shelters for days at a time. This consideration trumps the Israeli political establishment’s great fear of a Lebanese quagmire and the enormous costs of mobilizing for a long war.
The Hez may be getting desperate. It appears the rocket attacks on Israel are becoming less effective, which suggests that the remaining launchers are being pushed back from the border and/or that the most-skilled Hez crews have been put out of action. But since the Hez are still firing salvos (albeit less-accurate ones) of short-range rockets as well as occasional larger, long-range rockets, the Israeli public will keep up the political pressure until the rockets stop coming or Hezbollah is destroyed as an effective force.