The 226 was originally designed and perfected in 9 mm. IMO it is one of the best 9 mm pistols. I would like to have one if I had more safe space and money.
It was produced in 40 cal to satisfy a demand for sure. Many 226 shooters probably have both calibers. But I believe that the 9mm is more suited to the 226, specially if you want longer pistol life.
Actually the 40 cal was designed so that existing 9 mm pistol designs at the time could easily be chambered in 40. Notice that the head diameters are the same so that in theory, a simple barrel and mag change is all it takes to switch calibers. I also believe that with some pistols, 40 cal mags will accept 9mm cartridges and feed reliably as well.
But the 40 cal fires a bullet that is about 45% heavier than the 9mm at approximately the same velocity, although both are high pressure cartridges at about 32,000 cup/(psi?).
I don't know current rules, but if you intend to get into shooting sports where ammo power factor is an issue, then the 40 cal is easier to load to major. 9mm will probably limit you to minor.
The same pistol in the bigger caliber will definitely be more stressed.
If you intend to shoot a lot in practice, get the 9mm version.