Why does IUCN classify pistachio as a "Near Threatened" species?
Short answer: They were talking about the wild species.
Using the presentation by a Farm Advisor and a Pomologist, Pistachio Cultivars as a rough indication of the state of the species, we see that the commercial crop does not have much diversity.

Probably 97% or more of the pistachio acreage in California is planted to the Pistacia vera female cultivar called ‘Kerman’ and a P. vera male called
‘Peters’.

The presentation mentions that other geographic regions prefer other cultivars. But generally, the the entire commercial population of pistachio seems to be limited to a few tens of cultivars.
The IUCN Red List that I cited in the question is rather poor on the details. However, the publication, Geneflow '06, included a report on Uzbekistan's pistachio:

Saving Central Asia’s pistachio diversity
For three millennia, pistachio trees were used in metallurgy and mining in Central Asia due to their accessibility and the highly calorific charcoal they produce. The result was a major depopulation of wild pistachio in the region. During the Stone Age, pistachio trees in Central Asia covered approximately 2 million hectares, compared with only 300 000 hectares today.
The loss of wild pistachio diversity in Central Asia has major implications for pistachio growers in the region and beyond. Most of the pistachio gene pool is to be found here, where it is needed to underpin the continued availability of the tasty nut.

All the reasons they cited as factors for threatening the species likely refers to the wild trees.