I don't think Apple did anything magical here, and from what I can tell there's no lock in. You could load your ID to any number of places for this verification, it's not just locked to Apple.
The key part is that it's a private company offering something that is opt-in. If the federal government mandated it, it's almost certainly a 10th Amendment violation (via commandeering). It would also effectively make the currently de facto second class citizenship of those who entered without inspection including DACA recipients into de jure second class citizens and under current law, for life. It would fall squarely into the small part of the opinion landscape in the US where both the right and the left would have reasons to hate it.
I'm not sure there's any reason to mandate that exact solution.
It seems more likely that they would mandate age verification. This would be one way the government could support to do that. There's no reason PornHub couldn't support this, or other methods (or just one or the other). I think the law would say "a site has to verify the age of the user", not "everyone who wants to look at porn has to have age verification via a smart phone".