They are both being paid, and not by each other.
So whether it’s moral or not depends on who “signs the check”?