Three aspects: ad blocking, fraud prevention and DRM. Of course all platforms have their internal APIs but if they were to become too public you'd instantly see "artists" artificially bumping up their listener ratios for higher payouts, you'd see people developing third party clients (or patches to first party clients) to evade advertising, and you'd see people just blatantly ripping the catalogue.
Of course all of these things happen at the moment already, but the scope is limited for now. Security by obfuscation is not true security, but at least a (massive) impedance.
DRM, yeah okay, valid reason.
IIRC, at least Netflix and Spotify have a "pay less, but get some ads" tiers, and YouTube doesn't want SponsorBlock et al to impact the golden geese too much.
> As for artists trying to push their own listing ratio, why would that matter
People have scammed streaming services for millions of dollars [1]. Sure, at their scale it's peanuts, but still eyewatering sums of money for normal people.
[1] https://www.gzeromedia.com/gzero-ai/the-10-million-spotify-s...
Someone should do API music, you just get an API token and the API documentation. Having the ability to use something like old-school xmms with an API integration to a streaming service would be amazing.