For the record, I also think it is an insane practice and would personally take the buyback as an opportunity to sell. That being said, here is a view from which it might make sense:
0) Assume that there is an optimum debt/equity ratio for a company (no idea how it shakes out in practice, but there is probably some rule or theory that suggests an optimum debt level, like the Kelly Criterion suggests an optimum quantity to risk compared to available capital).
1) The accountants have calculated that due to the difference between your return on capital and the market interest rate, you should have borrowings equal to 20% of your shareholders equity.
2) The company's shareholder equity grows organically because it is doing well.
3) The company wants a higher debt/capital ratio, and investors are demanding some profit be returned to them, so borrow the dividend money directly and gives it out as a share buyback, optimising the debt/equity ratio at the same time. This is an administratively neat way of getting the money for the buyback together in one place.
There is a fuzzy spot in the argument in that you are returning money to investors at the same time as your return on capital is better than the market, but stranger decisions get made. CEOs and investors don't complain about high stock prices.