Someone would have to gather that data. It's not like a password that can be detached from physical reality. Your date of birth is somewhat inherent to your identity.
Suppose I want to start a business where I don’t want the liability of having to deal with all the laws about minors. Then I can use the government API to only allow people over whatever age.
That is not a reason for the government to not do something. We entrust them with nuclear weapons and aircraft carriers. Not to mention Snowden already proved the government has back doors into all the big tech companies, so it’s already not a secret who is visiting what website. And FISA courts and secret warrants under gag order and blah blah.
It’s just inconvenient for everyone.