Why does the Gemara hold that a hesped is given either for the benefit of the niftar or the living relatives? Why couldn't it be both? Surely both get benefit from a good hesped given for the kavod of the niftar.
Good point, surely both elements are present. However, the Gemara's question is which of these elements was the reason for which the Rabanan *obligated* Hesped.
The reason it is important to know the reason for the Takanah is in order to determine the Halachah when a person says that he does not want to be eulogized, or when the Yorshim say that they do not want to pay. For this reason we need to know why the Takanah of Hesped was enacted.