I agree on contributing back to a community and there's many ways to do that. That's not every producer's motivation though. Some do this to get paid and it makes sense to publish behind a paywall to do so.
Follow up question. What are opinions on publishing technical books?