It's not the only drug treated this way. You can go to any pharmacy and see a ton of things on the shelves that are just cards you have to take to the counter, and then see what's actually behind the counter. Insulin needles, for instance, even though you can also just buy those in bulk on Amazon. I'm not sure what does and does not get tracked in a statewide database, but at minimum, regular Ephedrine, typically sold under the brand name Bronkaid, is tracked this way, because it can also be used to manufacture meth. I don't even think in this case there is an alternative formulation like there is with Sudafed and generic equivalents.
The monthly purchase limits on these tend to be ludicrously high, though. I think they're state by state, but in Texas, you can purchase up to 9 grams a month.
Lots of what you described is very location-store specific. That's why you can buy a lifetime supply of clean needles on amazon, but buying any in CVS is requires waiting in line longer than it take for amazon to deliver.