Because the investors/stockholders in the tech industry started tightening the belt and demanding profitability from these huge tech companies. What's happening at Google is happening everywhere: the avenues for extracting more profit from their apps or services are being scoured and taken advantage of. Prices going up, advertising increasing, free features removed, etc. Different strategies all around, but the pattern is clear.
YouTube has never been profitable, but Google was ok with letting the rest of the profits from its other divisions subsidize YouTube's losses so it could remain free. They did that to choke the market; no other company could handle the sheer scale of it while offering it for free. As long as Google ran YouTube for free with relatively few ads, no competition could ever possibly come to exist.
But because the shareholders are demanding profit now, and because Google itself is struggling on multiple fronts, the time to force YouTube into a profitable enterprise has come at last.
And this is what it looks like.
As for risking competition, at this point, I don't think they care anymore. Competition in the web service and software space seems to be a thing of the past. Users are intransigent, algorithms favor the oldest and most popular services, and content creators seem to be incapable of separating themselves from their abusive platforms.
I also have a theory that Google is using YouTube as a way of rallying all platforms and services to combat ad blockers more fiercely. If they can beat them on YouTube, other sites will dig their heels in. There's a long-term strategy here to nuke ad blocking permanently. That's what that web environment integrity shit was about, and you better believe that will be back with a new name.