You also should spend a portion time learning as it enables you to create more value over time.
And yes you should take time to get to know your colleagues, take breaks, play ping pong, etc. This helps you refresh yourself and avoid running out of steam.
But the work is meant to create value, hence why you are rewarding with currency you can exchange for things you value.
Manage a positive work life balance and and do the "fun" stuff outside of work. Life is not all work and work is not all of life.
That makes sense as long as it also matches the employee's goal of being paid for the work they do. If you work at a place like my job, you will never be promoted if you do this necessary behind the scenes stuff. It's as if the motto is "if the business user doesn't see it, it never happened". Sucks if you're spending a lot time on things that are supposed to be invisible to a user, like security or availability.
Rare? Absolutely, but so is finding good people in general. Gather whatever signal you can, and keep rolling the dice, just as you would with friendships and romantic relationships.
In terms of developer productivity, it all depends on management's assumptions built into their labor model. If you are paying top of market for "A players" who do "10x," the company might need the few engineers it has to do a huge/unsustainable amount of "focused work"
If management's model depends on high-potential team members upskilling on the job, "the fun stuff" might just be priced in.
The above are absolutely reductive and do not cover all cases.
So even if you find a boss/employer that is supportive of “the fun stuff” for a season, that will eventually come to an end.