Basically because there differences between iPhones meant to be sold in place and others meant to be sold in another/
For warranty, this means any potential warranty replacement iPhone may not be identical to the one you submit.
For instance iPhones meant to be sold in Japan, have the Camera shutter sound permanently enabled due to legal requirements there. If you take an iPhone from the U.S, and have to get a replacement, you'll get one on which you cannot turn off the shutter sound, because all iPhones used for replacement in Japan would have this limitation.
The United Arab Emirates for instance, limit the usage of Facetime, on only very specific middle eastern carriers and nowhere else. So if you had your iPhone replaced there, you are likely to get one that will not have facetime anywhere else in the world.
There also the chance that iPhone in a specific country may be locked to a carrier there, Which means if you take an iPhone from anywhere else, and get it replaced, you get a phone that may be locked, and would not work with your sim card or carrier.
To avoid all these issues with variations on devices, they simply cannot and in most cases will not honor the warranty outside the country of purchase. As it would cause many more issues than simply getting back to the country of purchase could ever cause.