Because spreading the payments over a longer time frame lowers the payment amount and longer terms provide more price certainty. Beyond that, inflation means that the actual value of the payments in distant years is much lower.
Mathematically, the longer the term, the lower each payment has to be. Companies are generally very aware of their cash flow so it is almost always advantageous to decrease the amount of any payments a company is required to make. Over long periods, most companies expect to have downturns and it is quite helpful when something unexpected happens (such as a worldwide pandemic) to have lower required payments every month or quarter so that the company can make its cash reserves last as long as possible.
At the moment, interest rates are incredibly low by historical comparison. If you're issuing bonds to purchase a very long-lived asset-- a plane, a factory, etc.-- you can be pretty certain that at some point, rates are going to be much higher than they are now. Of course, that's not guaranteed, it's just unlikely that rates are going to be permanently lower than they have been in basically forever. If you're issuing 7 year bonds, that means that at some point when you roll over the bonds, you're going to have to pay those higher rates. Locking in now prevents you from discovering in 20 years that the world is back to the double-digit rates of the 1970's just when the company needs to roll over its debt.
When you consider inflation, future payments are much less costly. If inflation runs at 3%, the actual value of future payments drops by more than 50% every 24 years. If you issue a 50 year bond, the last payments will be worth less than 25% of the current year's payments. For a 100 year bond, the last payments will be less than 1/16 of the value of the current year's payments. Lenders understand this which is why they often charge more to borrow for longer terms but it is still valuable for companies to know that future payments will be much more affordable.