Earlier quoted context omitted.
Well, that's not all the law does. It also strips anonymity and, therefore, privacy.
My beard is gray but the government requires me to show a valid state ID when buying booze, cigs and porno mags at the gas station. If that's not a violation of the Constitution, why should carding people on porno websites be different?
The difference between showing ID to a clerk and this sort of thing is recordkeeping. A clerk is only checking the DOB on the ID, not keeping a record of your identity[1]. Online age checks keep records.
If there were some way of doing an age check without having your identity attached to it or having to expose yourself to some commercial third party, I wouldn't have an issue. That's a tough nut, though.
[1] I'm aware that certain businesses do keep a scan of your ID, but they're the exception and not the rule.