The pharma will likely also be employing people who were trained on the public bankroll. Not sure what's reasonable there though, it's not like society owns your output because you had your education paid for.
I'm not sure if we are thinking of different things, but in the UK I believe Drs and Nurses have to stay with the NHS (or at least not work for the private sector) for a certain period of time, if they got bursaries. That seems reasonable?
Society benefits from their output, in return for paying for their education.