The new owner pays for it.
Likely the vet simply knew someone with deep enough pockets who loves dogs and was willing to take one for a well above market fee. It doesn't seem unethical to me that person only wants to save dogs they own.
I wish I didn't know such arrangements are happening.
Every single one I know has a small menagerie of broken animals.