The obvious answer is “charge a reasonable price”.
Many services like AccuWeather do that, including having a limited free tier for experimentation or niche applications.
The real problem though is that the value of the data isn’t just the cost of storing and making it available - in many cases its strategic. This is why e.g. the Google Maps API gives you pre-rendered map tiles and curated results, but you don’t get access to the raw data.
I use Linux and tons of other open source software daily. I have published and maintain a number of open source projects, and contribute regularly to others.
I also pay for closed source software and have a few proprietary apps that I sell.
There’s a place for both models, they’re not exclusive.