What is the purpose in buying a gun that fires a caliber different then the one you will commonly use? I guess I am back to the "why" factor. If you want to shoot .40 there are many nice .40s out there to chose from.
This is a valid question and for me, it's extremely easy to answer:
For many years, 10mm was my choice for daily carry and regular practice with it is an important part of my routine (and for many or most who carry) and as are most 10mm fans, handloading is the way to go. As such, the 10mm brass is very important. You don't just "find" the stuff scattered anywhere and everywhere and it's odd enough that you also rarely see bags of used 10mm brass offered for sale.
.40 S&W brass is on the far, FAR other end of the spectrum. Next to 9mm brass, it's easily the MOST plentiful stuff on this planet. It's scattered everywhere and even many .40cal handloaders don't bend over backwards to pick the stuff up.
So wanting to run a favorite 10mm pistol with .40cal brass is almost a natural inclination for any 10mm fan, and we know going in that YES, it's not shooting exactly 10mm loads, but it still offers a lot of repetition and practice with the handgun itself, something that isn't replicated quite as well with a whole different handgun, especially when you are talking about a carry gun, a holster for it, etc etc.
Furthermore, especially for some of us who are long students of handloading and internal ballistics... .40cal specifically brings a different thought process to the load bench because it's early history was inundated with "over-pressure events" and problems associated with the cartridge itself and as much/more the platforms built for it. This subject takes off on a tangent very much away from the original topic, but it's absolutely
relevant for some of us and the bottom line of it is... .40 S&W run from a 10mm pistol (rather than a .40 S&W pistol) is a fantastic idea if that's what you wish to do. Most/many .40cal pistols began life as 9mm guns adapted for a larger round, where 10mm pistols typically started life as .45cal-sized guns that were adapted for a smaller-diameter round.
Me, I carried a Glock 29 for more than 7 years and have run over 6,500 rounds through it. I bought a KKM .40 S&W barrel for it to handle .40cal ammo and my log reflects that 3,400 have been 10mm through the OEM barrel and 3,100 have been .40cal through the KKM barrel.
So to answer the quoted question, oh
YES there are great reasons to buy any particular guns, even if it doesn't seem to occur to you quickly.
To answer the OP, I don't believe there is much of a safety risk in shooting .40cal ammo in Glock 10mm pistols, or in any 10mm pistols. However, I don't think it's a favor to the pistol, especially the extractor, and I won't do it. However, if I were going to do it, I think Glock is the best platform for it simply because Glock pistols are ugly, soulless, easily replaceable, easy to get parts for, and Glock pistols are extremely durable and a very good defense against poor use, bad practices, neglect and abuse.
I won't do it in any of my 10mm pistols, but you can bet your life I will never do it in my Smith & Wesson 1006.