Obviously, there is a concern about F-22 tech getting in the hands of China, Russia, etc if it’s sold to Japan, the UK, Australia. But it may eventually anyway, and if the US does all it’s production first, and is working on the next gen at the same time, by the time our allies get to buy, it’s probably too late for an enemy to get too much of an advantage, because it takes years to integrate the tech they mught steal into their own designs. Plus, the bottom line is that we need a higher production run to be able to afford the number that we need.
Besides, if we do what the Russkies used to do - only sell an export version (i.e. not quite bleeding edge), then the Russkies and Chinese will be even further behind the technological curve while we build more F-22s at a lower cost per.