Cost core to our resource allocation system, for better or worse, and if something costs a lot it usually means we can't do it as much. In this framing, cutting out animal testing would (often) mean medical research is slower. In this framing it's a question of where people are willing to put the dial on ethics vs results, and of course pumping the breaks in one place without universal buy-in just means the cruelty moves elsewhere.
I don't think the above 1-dimensional framing is the whole story though. You could imagine more standardized data sharing, so that the data that cost the lives of a few thousand rats could be used by others. And of course you could require (as drug trials do) that the study be registered before any experiment happened, and that the results be published regardless of the outcome. Some of these changes could actually make the science better, in addition to more ethical.
[1]: https://public-inspection.federalregister.gov/2026-19350.pdf
For most drugs the only reasonable test animals are mice and rats. And they LOVE to naturally get cancer and other diseases, so you need to use large groups to get even a semblance of statistical significance.
Oh, and don't forget that it takes a lot of time to run the tests. And time IS money for pharma.
There are ways that animal testing could be made far more humane (like birth control to prevent the kind of overbreeding that demands mass culling), but those, themselves, would be costly.
And in order to test cures, you must first inflict the animals with the disease. How many do you need? Are you sure? Because waiting to produce more later would also create costs. Cheaper just to breed a huge batch now and then cull the surplus.
... so how many extra do you want?