The very reason we have capitalism is that we have dynamic system that reacts to feedback and finds or at least moves the system towards a new optimal point given the new circumstances.
If there is a operation that exists free market would make that operation as cheap as possible and weather it is your decision to need the operation or not, you will still get a very cheap operation. For the market is irrelevant why the demand exists, but it will attempt to satisfy that demand and we are all better for it.
So the problem with opioids is about demand.
People should trust doctors to give sound advice regarding their opioid consumption, as they do with many other things. The majority of people don't want to be addicted and are happy to comply with measures.
There are a couple problems, first, the doctors primary earn money by selling stuff thanks to the perverse system of intensives that the modern american health care system produces.
Second, there was a actual problem where doctors in the US, by themselves started to over-issue these drugs, and they still do. That is as much a cultural problem as it is anything else. This has to change.
Third, I think its pretty clear that the distribution and demographics about this issue tell a story that is hard to explain by a general 'evil capitalist' pushing pills on people. It is clear that some communities are dis-proportionally effected and that is a more deterministic factor then the price of the pills.
Fourth, if there were actually free markets people would buy high quality product that does not kill you. People who take it might be addicts but you can be high functioning and your chances of recovery are much better then with this disgusting stuff people are forced to consume because of government regulation.