This is not the only issue with Pascal's Wager, but what is described in the question is called the fallacy of proving too much. It happens when an argument is structured in such a way that the reasoning can be extended to reach "absurd" conclusions. This gives an effective strategy for refuting arguments on the arguer's own terms by exposing the fact they prove too much. Silvestre describes it in On the Logical Formalization of Anselm’s Ontological Argument:
"Traditionally, a counter-argument in this sense is an argument that shares the same logical structure of another argument, has true or reasonable premises, but an absurd or patently false conclusion. In this way, since we cannot accept the conclusion of the counter-argument, we cannot accept the conclusion of the original argument either: despite its apparent soundness, there must be something wrong with the argument (although this method of refutation does not say what is wrong)."
A famous example of this is Gaunilo's counter-argument to Anselm's ontological argument for the existence of God, discussed in the paper. Very briefly, Anselm argues that God can be conceived as perfect, and therefore must also exist in reality, because otherwise he would be imperfect. Gaunilo objected that if that worked then the "perfect island" must also exist (and by extension any other conceivable object with "perfect" attached to it).
However, the validity of the reasoning's extension, and the judgement of the "absurdity" of the conclusions can both be questioned. For instance, one could argue that transplanting Pascal's Wager onto the devil does not work because with the devil there is no guarantee of "infinite reward": after all, he is a deceiver. Silvestre discusses diffusing Gaunilo's objection along this route. And sometimes proponents of an argument are committed to it enough to be willing to accept the seemingly "absurd" conclusions of its extensions - this is called biting the bullet.
Other issues with Pascal's Wager include illicit use of probability concepts and either equivocation on "God" or a false dichotomy, if the Christian God is presumed. For instance, if the Christian God does not exist but some other one does then Pascal's inference that one avoids "infinite losses" by betting on God is invalid, see Bendz's webpage on the Wager:
"The main problem with Pascal's wager is that it suffers from the fallacy of bifurcation. It only calculates with two options when there are, in fact, at least four alternatives: the Christian God and afterlife, some other god and afterlife, atheism with afterlife, and atheism without afterlife... Because Pascal's wager fails to tell us which god is likely to be the right one, you have a great probability that you picked the wrong religion and go to some other religion's version of hell. This is referred to as the "avoiding the wrong hell problem"... Believing in the wrong god has one additional problem. Most religions assure you that blasphemers will be more severely punished than un-believers. Once again, if we calculate with the rest of the possible gods, the chance of you being wrong is P=1-1/n so you both run a bigger risk than the atheist of being punished and risk the greater punishment."
And the list of problems goes on. But I believe it is the false dichotomy that exposes the Wager to proving (or rather motivating, since it was not intended as a proof) too much. There are just too many "unlikely benefactors" with potentially "infinite" rewards and losses. To run cost/benefit analysis on one of them we must run it on them all, but we can not bet on them all together because many are mutually exclusive. As a result, there is no viable alternative to not betting at all, contrary to what Pascal assumes. The Wager would work only if one of the alternatives (or several compatible ones, e.g. Christian God for Pascal) can be shown to be likely on other grounds. But it should be said that Pascal himself never intended the Wager as a rational argument. Indeed, he writes:
"“God is, or He is not”. But to which side shall we incline? Reason can decide nothing here... Your reason is no more shocked in choosing one rather than the other, since you must of necessity choose... But your happiness? Let us weigh the gain and the loss in wagering that God is... If you gain, you gain all; if you lose, you lose nothing. Wager, then, without hesitation that He is." [emphasis added]
For more on objections to and defenses of the Wager see IEP and SEP articles.