Having state-mandated software running on every device sounds like a much more invasive solution, and more easily turned against device owners.
Whereas making online service providers responsible for the content they offer is more lightweight for the end user and is more consistent with how it's done offline, like with age verification for certain types of purchases.