The question was not Why do they do this? but Why are they allowed to do this? as in this should be an Apple choice, not a YouTube Choice.Probably because Google is an extremely scummy corporation
My answer would be:
YouTube: We want to block users from listening to audio and video in the background in our app.
Apple: No, that goes against our API, and make the user experience worse for our users. If you want to be on our platform you need to abide by our rules, and not hurt our users. We care about our users.
YouTube: We were going to charge a lot for that feature, and you'd get 30%.
Apple: We'll change the API.