Earlier quoted context omitted.
Why not just pay a dividend? That's what stocks are supposed to be, shares of ownership in legitimately valuable enterprises with return on investment.
The purpose of an IPO is to raise money to do something. It doesn't make any sense to sell part of your company to a random set of people, just to pay them back over time. That's like me getting a mortgage for my house and after 30 years I pay back the mortgage and the bank still gets to own my house.
It's unfortunate that this doesn't make sense to you, because that it literally the original purpose of shares in a company.
Someone wants to finance a voyage to a far-off land to trade. To do so, they form a company and issue shares of the company. The profits off the voyage (if any) are then divided amongst the shareholders, in proportion to shares held. It was a pretty good idea.
(Debt is not the same as equity, not sure why you are talking about mortgages).