Certain OTC and prescription drugs definitely require an ID. Think coffee syrups and potent pain meds.
That’s in Minnesota at least, and I’m guessing they’re state level laws.
In my state, none of those require ID if a prescription.
Pseudoephedrine does if purchased without a prescription.