No you’re totally right, and Derek from Veritasium does point out that being hated shouldn’t be a moral compass. I think the point is more that you should know that even when you’re doing something right some people, maybe many people, will hate you for it. Incidentally if you’re doing something wrong you might be quite popular as well. Popularity isn’t a good judge of character.