A decade ago Karen Hunter (at that time Senior Vice President of Elsevier) did a brilliant analysis why scientists publish:
For academic scientists, the research paradigm is the experiment and the publication output is a journal article. Academic science researchers publish to establish their claim at a specific time to a specific result. They publish to gain other forms of recognition (such as promotion and tenure) that require publication. They publish in order to have independent certification of the results and to have those certified (refereed) results archived in perpetuity. Finally, they publish to communicate with those who may be interested in their works today …
She continues with another important aspect
… not the circle of cognoscenti (who do not need publication to be informed) but researchers in related fields, researchers in less well-connected institutions and students working their way into the inner ring.
In my opinion, the “claim at a specific time to a specific result” is probably the most relevant motivation for a scientist. Nevertheless having claims on ideas presented in a printed paper seems to be still a habit of the pre 1995 stone age of scientific publishing. Databases will be certainly as reliable in the future as printed paper. I guess that in 50 years the access to current electronic documents will be even better than to any printed paper. Yea, yea.