Well, averaging isn't exactly implied by Harsanyi's theorem, as suggested in the accepted answer, but only a linear combination of utilities. As Risse points out:
Harsanyi’s theorem [...] implies the existence of certain coefficients for a given profile of utility functions, but for a different profile, we obtain different coefficients. However, a complete formulation of utilitarianism requires the multi-profile
format. For it is utilitarian doctrine that each person count equally. An explicit
formulation of this claim would stipulate that the aggregation be indifferent
between two distributions that only differ in terms of the distribution of the
overall utility across persons. But such a condition must compare and thus
refer to several profiles at once and cannot be captured in the single-profile
format. Therefore, as discussed here, Harsanyi’s theorem cannot make a complete case for utilitarian summation. So we should think of Harsanyi’s theo-
rem as providing an argument for the summation method as such, while not
implying anything about the weights given to the individuals. An argument
for equality must then come from elsewhere.
(Emphasis in original.)
Nor was that paper the first to notice the issue; Amartya Sen is a [far] more illustrious critic; as quoted by Mongin:
the lack of a multi-profile equivalent was part of Sen's objections
to Harsanyi's approach. Let us briefly review the reasons for which he claimed
that the Impartial Observer and the Aggregation Theorems are not proper
axiomatisations of utilitarianism.
What is needed is an axiomatisation that (1)
permits independent formulation of individual utilities, and (2) which has the
invariance property of having the set of ai [ = the weights given to the individuals
in the utility sum] determined independently of the utility functions to be aggregated (and in particular having ai = 1) (1986, p 1124).
[...]
Sen's point [(2)] here appears to be that the standard Aggregation Theorem takes the
(n + 1)-utilities of the individuals and the social observer as given, and therefore
makes the weights a dependent on the chosen profile. That is, Harsanyi follows
the traditional Bergson-Samuelson approach to the "social welfare function."
We agree with Sen that this is inappropriate for an axiomatisation of utilitarianism. One major reason that this is so is just alluded to at the end of Sen's
quotation and can be made explicit as follows. In contrast with affine or weighted
sum rules, which have been rarely defended in the tradition of ethics and political
philosophy, classical utilitarianism always involves uniform weights, be they
equated to 1 - as in Bentham's sum rule - or to 1/n - as in the (also time-honoured) average utility rule, Harsanyi's own favourite. To go from the affine conclusion of the Aggregation Theorem to classical utilitarianism one must satisfy a symmetry requirement which cannot, strictly speaking, be stated in the language of single profiles.
Now, it is actually possible to derive a multi-profile version of Harsanyi's theorem and Mogin proceeds to derive it, essentially relying on the welfarism axioms. Essentially, in this context, a mixture-preserving (MP) function replaces the NVM utility. However while this is technically an interesting result (and the author also discusses how it skirts Arrow's impossibility theorem), the issue is that it's not really a philosophical or factual leap because:
MP representations of the
individuals' VNM preferences are cardinal in the sense of being unique up to
positive affine transforms but not necessarily cardinal in the more relevant sense
of measuring the intensity of preferences. [... And] evidence is by and large unfavourable to the claim that MP functions adequately measure preference differences, as independently revealed to the experimenter.