Presumably most of the subsidy goes toward paying the resident, so most of the value to the hospital of the residency is the work done by the resident.
https://www.reddit.com/r/Residency/comments/hdx3gw/no_laughi...
Based on what I've read, I suspect residents are very profitable for hospitals, even if they use a significant portion of the grant.