Why should a browser be policing YouTube’s ToS for them?

Agreed, this sounds strange indeed. Much more likely is that Google found a reliable way to detect the screen status using a standard feature and Mozilla just implements the standard neutrally

Wouldn't know, as I have never been in charge of one, but I imagine Google having the power to make your browser completely irrelevant would be a pretty strong incentive.