I don't know so much about Moderna and Pfizer, but an investigation by the Guardian looking into the Oxford/AZ vaccine found that 97% of the research costs were publicly funded. Interestingly this isn't just the cost for researching the vaccine since early 2020, this is the cost of research going back to the early 2000s covering the development of the vaccine technology as well that underpins it as well.
https://www.theguardian.com/science...covid-vaccine-research-was-97-publicly-funded
A quick google search suggests for Pfizer the German government gave 445 million up front to accelerate research while the US committed to buying 100 million doses ($2 Billion) before anyone knew whether it would get FDA approval an committed to buying another 500 million if that approval was given.
I know the Covid vaccine has had a different evolutionary process to most others but the companies here were never taking the huge financial gambles that they'd like us to think.
If governments cover some or all of the costs of development then the contract should have built provision for cheap/free distribution in developing nations into the contracts. I'm sure there are (and should be) solutions but I think simply cancelling copyright is fraught with danger and likely illegal anyway.