Protecting human, animal, and plant life or health from additives, toxins, and contaminants in agri-products and promoting green free trade are the main components of Sanitary and Phytosanitary (SPS) measures. However, the SPS measures are heterogeneous. This study examines the impact of SPS measures on the measured export quality and discusses their influence on the environmental protection of the exporting country. International heterogeneous measures do not necessarily promote quality upgrading but greatly increase transaction costs. By contrast, China's agri-product' quality upgrading and environmental pollution are in sharp contrast. Based on a heterogeneous firm-trade model, this study obtains three hypothetical propositions and conducts empirical regressions using the Tobit method. This study finds that heterogeneous SPS measures hinder quality upgrading because firms present a different quality upgrading trend, which in turn impedes the environmental protection of the exporting country; the quality upgrading made by diversified SOEs is higher than that of foreign firms and private firms; the quality upgrading made by general firms is higher than that of processing firms; and protective SPS measures have a stronger negative effect on quality upgrading and environmental protection.