Leopardi is quite possibly my favourite poet, this despite my reading him in English and being aware that quite a bit must be getting lost. Anyway, David Bentley Hart reviews Zibaldone published a few years back pointing out in his review Leopardi’s paradoxical cast of mind as does the always insightful John Gray (second and third quotes)
He had a particular disdain for the beguiling myth of progressive enlightenment. As far as he was concerned, all cultural values are historical contingencies; and those of the modern age enjoy no conspicuous superiority over those of antiquity. Quite the reverse, in fact. He saw the tension between traditional religious piety and scientistic rationalism as no more than the natural hostility that exists between incompatible, and equally arbitrary, dogmatic adherences. The latter devotion has perhaps brought about considerable advancement in the sciences, but this he regarded as anything but an unequivocal good. The practical benefits of modern science can hardly compensate for the abyss of meaninglessness that modern rationalism opens beneath our feet, or for the surrender to total nihilism that it invites.
Leopardi found the unthinking moral certainty of secular thinkers highly questionable, not least because of their hidden debts to Christianity.
Realising that the human mind can decay even as human knowledge advances, Leopardi would not have been surprised by the stupefying banality and shallowness of current debates on belief and unbelief. He accepted that there is no remedy for the ignorance of those who imagine themselves to be embodiments of reason.