This is the same thing.
"I used to get my work done on time and leave"
This sounds like you just wanted to get your work done and not foster any work relationships. This is fine, but you will not get promoted this way (as you've seen).
Moving up in a company is 30% work and 70% networking/being likelable/noticed.
I stopped that nonsense years ago. I work for myself now as a consultant. If I work more, I get paid more.
While it may be true that it's pretty standard, I'm convinced that any organization that relies more on face time and friendships than on actual skill is absolutely toxic.
There are other reasons why the bad behavior gets rewarded. If the management is incompetent, they genuinely focus on the optics and not on the actual work. And if they are competent, they understand that the people who stay behind unnecessarily or come over the weekends are more exploitable in the long run. And if the people in management are the kind of people who stay behind unnecessarily, having a team full of people who do the same, rewards them as well.
It's ultimately a combination. A pretty good software developer who is friendly and pleasant is, in most organizations, going to get promoted over the grumbling angry software developer who is brilliant but everyone hates talking to. A lot of this has to do with most work at more senior levels being communication.