I always assumed this was part of their deal with records companies to basically prevent people using YouTube as a free music streaming service (while keeping music videos there). Partly because before iOS added picture-in-picture they had a feature to enable videos to keep playing as audio only in the background but ONLY if you had YouTube Red/Premium.
Having said that, they now enabled Picture-in-Picture on iOS (though last check it's still in beta I joined the beta a while back) and one of Apple's requirements is you cannot but OS features (such as Picture in Picture) behind an app paywall. So they could only do this by making it available to everyone including free users. Not sure what got them over the line but its there now.
So makes me wonder if that will go away - or whether they still enforce that requirement on Android, or what.