I think that Denethor, obviously over the edge, decided to spite the West and all that for which it stood. He was like a child throwing a tantrum, doing what he must have believed would really hurt his 'parents.'
That obviously was a cry for help.
And he wanted to torch Faramir too, as stated in the text, to ease his own guilt. I could see 'staying on' in a bad or hopeless situation if it were to, in some way, benefit my children or at least extend our time together.
Did Denethor also want to save himself the shame of losing Minas Tirith, and was he afraid that not only would his city fall but he personally would be captured and tortured along with his son? His 'reasoning' might have figured that it would be better to burn than to suffer to the torments of the Dark Lord. And a burned body may put him out of reach forever of Sauron - who knows what Sauron could do with one that was only mostly dead?
In the end he gets his wish, though in the PJ version I'm not sure if it were the fire or the fall that ended his life.