Europe is a big market, as condition of marketing some drug it can require having some capacity inside the EU, etc.
And similarly for chip foundries. Of course with chips the real trick is that the foundries depend on Europe due to ASML, but yes, your general point stands, and it's important.
What doesn't make sense is to prop up "domestic" companies that - in theory - play the same role in the global supply chain, but when actually it's time for them to step up, they just fell over and the whole things turns out to be three crony ducks, drunk on fancy local wine, playing big business.
There's no need to get the bleeding edge node factory here, but there's many advantages to having some capacity of the already well-understood high-efficiency high-productivity node here.
There's plenty of endogenous and unmet demand in Europe, but there's a lack of culture of providing long-termish solutions for it. (As in the EU funds very short-termist things, and there's the continuously ongoing land subsidy problem.)