In some states stores are required to scan IDs. I'd be surprised if e.g. Kroger weren't storing that information. All of these porn laws I've read at least ban any storage. As far as I know digital ID standards are also at least designed to allow only sharing "over18" without other identifying information.
Kroger is most definitely storing this information. I rarely shop any Kroger store, but when they started doing IDs scans, I shop there less and no longer buy anything that requires my ID.
Similarly, Wal-Mart seems to know who I am based on my card transactions. When I swipe my card they ask if I would like a paper or an SMS receipt. I’m still not sure how they got that number association.
You don't actually provide it to the porn site. Everything goes through a 3rd party escrow. The site you're trying to access only gets a message from the trusted ID partner that you are indeed the age you say you are.
Now, I still hate the idea that any corporation is storing my ID, but it's not every Tom Dicken' Harry porn site you might be viewing.