Every scientific paper has a few key ingredients, but the one that may receive rather little attention is the authors’ affiliation(s). Absent until the early/mid 20th century, authors’ affiliations were probably added to facilitate correspondence with an ever-growing community of readers.
Nowadays, it can be a loaded, political, and/or much discussed part of putting a paper together for a variety of reasons. Organizations, departments, and schools use it as evidence of research output for publicity, or internal and external evaluations. Indeed, in some places, authors (or their departments/institutions) receive financial renumeration for published papers, which hinges on the affiliations. Sometimes this can be gamed (in obvious ways), as more and more researchers are offered honourary positions at institutions where they used to work*, or collaborate frequently. Seeing authors repeatedly list 3, or even 4 affiliations often causes me to raise my eyebrows. Most (some?) of these are legit, but how many simply list affiliations so the institution can add the paper to their list of “papers published by our department/school/institute”? Adding such affiliations has no material cost to the authors, is highly unlikely to be questioned, and so becomes a question of personal ethics. I should add, though, that I suspect this is an extreme minority of cases.
As a general rule, authors should list their affiliation as the place where they did most of the work. In my case, this is fairly straightforward: if I primarily use data collected during my MSc, my affiliation is the University of New Brunswick (and I list my current affiliation as “Present/current address”). In some cases, though, the distinction between data/ideas/projects started at Affiliation A and those at Affiliation B may be more opaque.
Author affiliations can also be a political tool. Some institutions (primarily those outside academia) require approvals to publish, or authors may want to publish on topics that are outside the scope of their work. In extreme cases, authors may wish to make particular points or conclusions that could be counter to those of their employer (e.g., government policy), or their employer may not wish to be affiliated with a particular piece of work. I discussed this last scenario with a friend of mine who was told he couldn’t list his institution’s affiliation on a manuscript. His solution was to basically invent an affiliation (we amusingly settled on the nonsensical “Giraffe & Sons, Ltd.”, though I don’t think he ended up using it in the end, sadly) for work that he did outside of his day job. Similarly, it’s fairly common in ecology/conservation for researchers to do small bits of independent consultancy, which could include publication based on work done while on one’s own dime, so to speak.
On a more annoying/foolish/sinister side, affiliations have likely been used by some to infer the quality of the output (“Check out this new paper from Cambridge” can, to some, sound more impressive than “Check out this new paper from North-central Podunk State University” because some use affiliations as a proxy for quality. Which is utter bollocks).
I think affiliations do matter, though perhaps more so outside academia.
*I’m an adjunct professor at the university where I did a postdoc, but this was a requirement to co-supervise a student, and this affiliation appears only on papers associated with that student’s work.