Drug companies wouldn't be selling to other countries unless they made profits there. They just make absurd profits in the USA.
Once they have the drug developed it makes sense to sell it wherever they can, at whatever price they can get (above COGS and overhead, of course), as profit is profit—so long as it doesn't cannibalize their much more profitable sales in the USA.
If the USA were to suddenly allow retailers to import drugs at scale from other countries to reduce costs then those countries would find their supply of cheaper drugs drying up. They could either accept prices on par with those in the USA, thus eliminating the arbitrage, or simply go without.