"Harmful" content has significant overlap with freedom of speech, so governments find it hard to ban directly. But when there's a big corporation facilitating access to that content, then it becomes a clear case of "evil capitalist profiting from harmful content - corporations need to take responsibility!".
When a government doesn't like end-to-end encrypted photos and cloud drives, all they have to do is issue a secret order telling Apple to disable it.
And when people find workarounds for intrusive and insecure age verification methods, what's better than a total sideloading ban to regain control?