As someone who routinely uses both, I would say "it depends".
Scanner quality is highly variable. The cheap'n'nasty scanners do a cheap'n'nasty job, but not all cheap scanners are cheap'n'nasty. They're not designed to scan a 3-D object, and some of them simply can't do it. I've had a couple of excellent scanners; the HP scanner I used for 20 years was super-great (but HP are notoriously non-forwards-compatible so it lost most of its functionality with Windows 7 and stopped working completely with the arrival of Windows 10). I'm currently using an Epsom, which is almost as good.
Scanners, when they work well, have a couple of advantages. They're always in focus - so no mucking about with a photo stand and getting the macro settings on the camera right. They also "remember" the size of the original item being scanned, which is handy for what I use scans for (printing in a coin club magazine) - so no need to include a standard size reference object in the scan.
Their key disadvantage is they tend to make coins look "worse" than they really are. Scanners don't capture lustre very well, and tend to over-emphasize scratches and nicks - an MS-64 coin can look AU-50. If you're selling your coins, you obviously don't want that to happen. And in this modern era, another "disadvantage" a scanner has is that, unless you're a wizard with a Masters degree in computer science, you need to plug it into a PC. If all your Internet-surfing is done by tablet or phone like all the young people are doing these days, then needing to run to a PC whenever you want to image something is inconvenient - whereas your phone/tablet has a camera right there built into it.
Don't say "infinitely" when you mean "very"; otherwise, you'll have no word left when you want to talk about something really infinite. - C. S. Lewis