The free market take is that competition allows for faster development of more newer, better, cheaper drugs overall. That may mean the occasional crazy pricing, especially in a constrained market where only a few entities can supply a need.
The socialist take is that the government should intervene in cases where a need isn't being met in a sustainable way by the market, and people are suffering.
Another way to look at it might be that one prioritizes the future over the present.
I don't think it's controversial to say that both these are true in certain situations, and sometimes those situations overlap (such as with medicine). In a perfect world, we would have all the benefits of both the free market and socialist takes, without the downsides associated with each. It's possible we might be able to approximate this somewhat, such as with Shkreli's suggestion that the government take over production of generics. Other options are better public funding of research and development, so drug companies can shoulder less of that cost (and thus charge less to recoup investment and make a profit).
In the end, I think neither system is perfect, and both have very real advantages that we need to be careful not to discount.