Why is it acceptable that publishers sell papers they didn’t pay for?
History.

In the dark ages (i.e., before the internet), publishers provided a valuable service. If an author has a great idea, they want the whole world to read about it and the best way to do that is to get someone to publish their work. The publisher arranges for reviews, copyedits your work, and, most importantly, prints thousands of copies and sends them to libraries and archives around the world. (Note that, legally, they need to have the rights to distribute the work, and they claim ownership of the copyediting work.) Doing all this printing, mailing, and copyediting costs a lot money and thus publishers have to charge for their services. They also make a small profit from all of this.

Fast forward to the 21st century and the picture has changed considerably. Since the arrival of personal computers and software like LaTeX and Microsoft Word, copyediting is now mostly done by authors. (Reviewers and editors are rarely paid.) And, due to the internet, it is very easy to distribute papers using websites like arXiv. Going to the library to find a print journal is now a thing of the past, as journals these days just have websites.
Of course, publishers are still doing something, but it's a fraction of what it used to be.

Publishers made a lot of sense 50 years ago, but these days their model doesn't make a lot of sense; they still collect a lot of money, even though the services could be provided much more cheaply. So why does this model persist? Firstly, publishers still own the copyrights to lots of old work that is still relevant. More importantly, publishers own the "prestige" of their journals, which means academics keep sending them their work.