daf bit: Ketubot 108
The g'mara analyzes the argument. Elsewhere we learn that a man can pay someone else's shekel (Temple tax), repay his debt, or restore to him an object he has lost, all without benefit to himself, meaning he is not repaid. The shekel and restoring lost objects are religious duties, and repaying debt (some say, but this is disputed) spares the man shame. The g'mara does not here close the loop by addressing whether maintaining the man's wife in his absence also spares him from shame. (107b-108)
The talmud here does not raise the question of agency; if the husband had asked somebody to take care of his wife while he was away, that would be a different case.