The introductory econ course I once took mentioned the (apparently classic) lighthouse study[1], though now that I did a web search it doesn’t seem that unequivocal. Many 19th century projects were funded through public participation (the Eiffel Tower and the Statue of Liberty come to mind), even if the social value of some of them was questionable (though I think some railroads were built this way too?). Before that, I seem to remember that the Netherlands was made habitable (from essentially a coastal swamp) largely through private enterprise. In more recent times, the late engineer turned entrepreneur Dmitrij Zimin funded a significant portion of the Russian hard sciences in the 2000s and 2010s (after Soros grants got some of the people through the Soviet collapse in the 1990s and then ceased), though the problem is still far from solved.
It is peculiar that the model of fundraising via newspaper ads and a couple of wealthy donors (including in some cases the national government, yes) doesn’t seem to have survived past the world wars, but to say that private funding never resulted in any social good is preposterous. Something has happened in the last century or so, but it’s trickier than that.