Social security isn't a Ponzi scheme because enough people die before getting the benefits that it covers those that do. For example smokers will never see a cent of the social security they pay because they will die first.
The definition of a Ponzi scheme is paying off existing investors with money contributed by new investors. If it's a successful Ponzi scheme due to people dying, then that's a different argument. A Ponzi scheme is a ponzi scheme whether it's a success or failure.