Feels to me like this is good old "if a measure becomes a target, it stops being a good measure".
I.e. happiness is a good measure to identify other things in your life: If something makes you unhappy, address it, if something makes you happy, follow it. (Very simplified)
But if you make "maximizing happiness" the direct target without any context, you get drugs.