Just look at how agitated people here are getting at the prospect of GitHub copilot using tiny code snippets from their work for potentially commercial works.
Then imagine it’s not your unique way to loop over a file in python, but your medical information.
Often sources of this type of medical data will give them to universities under the no-commerical-use condition.