The prices help pay for the huge cost involved in developing drugs. How many drugs were developed in France in the past 10 years compared to how many were developed in the US? You know the answer.
The real reason drug prices are astronomical in the US is because the US government is legally prohibited from negotiating drug prices. So the pharmaceutical companies can literally set any price they want.
You don’t have this problem with certain government agencies that are exempt from this prohibition. For example the VA can often acquire the drugs for much cheaper.