It also forces China to develop its own competitor to ASML, which will eventually drive them out of the market.
ASML IP is already and will continue to be stolen by China, exporting machines to China just means that it will be stolen much faster.
To export or not hinges only on whether the problem matters from a short-term or longer term perspective. Either way, the Chinese will ultimately win.