From the hand of a non-Jew you may not offer any of these… (Leviticus 22:25)
Non-Jews were welcome to offer sacrifices in the Temple. In fact, they are encouraged to do so! At the dedication of the Beis HaMikdash, King Solomon spoke in some detail about this (see I Kings chapter 10). Nevertheless, only animals meeting the Jewish standard for blemishes might be offered, even by non-Jewish supplicants. One might think that if an animal is acceptable according to the tenets of the non-Jew’s faith, it might be acceptable; this mitzvah informs us that such is not the case (see Talmud Temurah 7a).
This mitzvah is actually an integral component of the story of Kamtza and Bar Kamtza (Talmud Gittin 56a). Bar Kamtza wounded a calf sent by the Roman authorities in such a way that the blemish was insignificant by Roman standards but disqualifying under Jewish law. When the sacrifice was declined, the Romans took umbrage (which was Bar Kamtza’s intention).
The reason for the mitzvah is what we have said about affording sacrifices the significance due them.
This mitzvah applied in Temple times, only to kohanim (who were the ones who offered sacrifices). This prohibition is discussed in the Talmud in the tractate of Temurah (7a) and, passingly, in Gittin (56a). It is codified in the Mishneh Torah in the first chapter of Hilchos Issurei Mizbe’ach. This mitzvah is #96 of the 365 negative mitzvos in the Rambam’s Sefer HaMitzvos.