If you pay money to Palantir, they are providing a service in return. That service is investment in your own economy, you pay them and then you own the thing they produce. Money does not "escape", the same amount of money is there before and after. The reason the UK is doing bad is this kind of bizarre economic xenophobia combined with a complete hostility to any kind of innovation or change. The question is: why don't we have a company competing with Palantir? Should be very obvious.
A free market is not a means to an end. Part of the reason that the USA was (until recently) doing so well was that the winner-takes-all mentality of the free-market benefits Silicon Valley, but that doesn't mean that other nation states have to submit to that philosophy.