One of the major players in this question is adaptation. The brain is a marvel of adaptation which software developers are still desperately trying to unlock. So from that perspective, it's a software issue. However, unlike many engineering efforts, it isn't "hardware leads to software." In the brain, hardware and software intermingle to the point where it is sometimes hard to distinguish them.
In the case of smell, the brain adapts to the particular sensors it has. This permits a different kind of sensor which is less a-priori specialized and more "we'll work with what we get." This can be a difficult kind of sensor to work with in engineering, requiring complex calibration and training. At some point, it simply becomes more cost and time effective to train a dog, leveraging a few million years of evolution.
From an engineering perspective, it's not worth spending \$50,000 to build a smelling machine and half a man year of training and calibration when you can put a female dog and a male dog together, wait for a free smelling machine to be produced, spend a few weeks training them (the smell training phase for drug sniffing dogs is around 3-4 weeks), and be ready to roll. Glendale Police claim the whole price of a K-9 unit dog is \$22,500. The typical engineering process is to turn up the precision in the process, so that you can roll out units with very little calibration/training. And while calibration/training is a software thing, it also has a major effect on the choices that the hardware team makes!
We simply haven't found a cheap, high precision, reproducible way of handling smells the way dogs do.
You mention the amazing things we have done with detecting light, spanning many wavelengths. But evolution is amazing too. Consider this Single Photon Detector.† It can detect single photons in a range of wavelengths just a little larger than "visible wavelengths." It costs $4,600 at the time I wrote this answer.
Our Mark-I eyeballs have detectors too. In particular the rods are very effective at sensing light. If given 30-45 minutes of pure darkness, the rods will adapt to the low light, becoming more and more sensitive. Once fully adapted, a rod is capable of detecting single photons striking it. This is done through a remarkable active feedback system involving several inhibition loops.
We have over 100 million rods in the human eye. That many Single Photon Counter Modules would cost over $4 billion, and take up roughly the volume of an Olympic swimming pool! Of course the data shows the human eye can detect a single photon roughly 1.6% of the time while the spec for that detector is closer to 20% on average and 35% at its peak, but since 90% of the light that reaches the eye never actually hits a photodetector, the photodetectors themselves have to be at least 16% effective at detecting this single peaks. Not bad for a detector no larger than the diameter of a human hair!
†Full disclosure: I have no relationship with Thor Labs nor this product. It was the first product recommendation for a google search for "Single Photon Detector."