I don't think that's quite right, unless you personally value joy for its own sake. I value knowledge, and joy is useful to creating knowledge, and suffering is harmful to it. But I don't want to have some futile joy, and I don't need to avoid some irrelevant suffering.
Otherwise you get effects like;
* Just take drugs, feel meaningless "joy" because that's what you value,
* Don't do anything less "joyful" even though it's more meaningful.
I'll admit that knowledge isn't practical, and you can't always identify when you're creating it, and a lot of people don't think in these terms and there's a lot of intuition involved, along with societal mores about caring for people which help the growth of knowledge as general rules without getting all bean-counting about it. But I think it matters that hedonism is an incoherent motivation and that creating knowledge is a far clearer one (and hedonism tends to turn into creating knowledge, anyway, if you like meaning). Hedonism, utilitarianism, same difference.
....I think it's a fairly widespread view to value joy for its own sake. In fact, I would say that's pretty much how normal people would say they view joy.
You could make the point that teaching, and thus furthering the collective knowledge of our species, may be somewhat objectively meaningful, because you impact the trajectory of humanity. But unless you draw joy from that specific fact alone, the joy from creating knowledge is just as selfish as taking drugs to attain a state of bliss (which, again, I don't oppose either.)
Also, I'd even challenge the notion that knowledge alone, at its face value, automatically equates to a benefit for humanity. Harari has made that point far more eloquently than I in Nexus.