Semiconductor factories are expensive, sure. Semiconductors are cheap and famously have been getting exponentially cheaper for decades.
And silicone that needs that high level of cleanliness is not cheap. Most chips are fabricated on larger/older processes that do not require that high level of cleanliness
That older level of cleanliness is still above a typical pharma factory level cleanliness. (Where there's no laminar air flow and no need for bunny suits, but everything is sterile and consumables like containers, pipes, feedstock is unpacked right before. And there are a number of verification (QA) steps before the finished lot leaves the factory. Just like with chips, just in the pharma/chemical case it can be done in bulk if it's in a homogeneous liquid phase.)