Bill is way too invested in this stuff for it to be a cynical PR effort. And he himself states it was his mother who inspired him to give: https://www.businessinsider.com/bill-gates-mother-inspired-p... If Bill's giving was a cynical PR play, why would he be pushing other HNWs to give through the giving pledge? Wouldn't it be better to discourage them from giving so he looks better by comparison?
Note also that a few years ago when Zuck pledged to donate 99% of his money, the internet erupted in incoherent anger. Similarly whenever the news covers tech philanthropy, the angle is always "well really this is something that the government should be doing, the fact that it is being handled by private philanthropy is kinda problematic". The giver's generosity is inevitably taken for granted. For the supposed PR benefits of philanthropy there is a shocking lack of good PR. Far more scorn is heaped upon wealthy philanthropists than rich people who just quietly buy yachts and stuff. Your reaction of "giving is just a cynical ploy" seems to be way more common they "hey, they are giving, that's pretty cool" in all the online discussions I have seen of billionaire giving.
BTW, did demonization of wall street in the wake of the 2008 crash trigger a wave of philanthropic giving from them?