Academics get their income from their university positions, and don't get any royalties from sales of their articles. Instead, the benefit they get from publishing is to their reputation, and for that it's better for their work to be as available as possible.
It's completely different for a writer who gets their income from sales of their work, obviously