Because PC manufacturers don't insist on modifying core Windows for their bloatware, and carriers don't insist on certification for each and every update.
If Google wanted, it could prohibit that practice. If you want Play Store, Youtube, Gmail, and all the other Googlies, you play by Google's rules. It ain't rocket science.
If Samsung decides not to play, Sony and Huawei will eat its market.
Sony is a fucking joke when it comes to software (no matter if cameras or phones). For what it's worth they're so small IDC doesn't even list them on the market share diagram: https://www.idc.com/promo/smartphone-market-share/vendor
Huawei is not going to eat anyone's market so soon, not with Google having cut them off from Android.
That is why the situation is better there.