The Alter Rebbe of Lubavitch writes:
ואף גם זאת דבן ה' למקרא היא ברייתא שלא הובאה בגמרא, ואינה משנה לגירסת הרמב"ם בפירוש המשניות עיין שם במדרש שמואל
That the statement of Ben Hei Hei commonly printed at the end of chapter 5 is not part of the Mishna of Pirkei Avos according to the Rambam and the Medrash Shmuel, rather it is a Braisa that is not brought in the Gemara (and thus could arguably not be relevant to psak halacha).
In addition, Double AA pointed out that older manuscripts of the Mishna don't include it.
I have heard of editions of Pirkei Avos that puts the statement before the end, perhaps to avoid finishing with something negative.
So given all of that, why was it added at all?