Banks will not loan you money to put it into the S&P. The wealthy generate money by generating credit in part.

They definitely will. JP Morgan for example charges SOFR+1.85% for 10M+ accounts[0], which is better than the mortgage rate they offered me. Or depending on what you mean by wealthy, you might be able to afford having someone get you a better deal by trading on the markets (e.g. selling SPX box spreads) assuming you don't have the expertise to do that kind of thing yourself/aren't interested in doing your own wealth management.

[0] https://www.jpmorgan.com/wealth-management/wealth-partners/l...

Why would you borrow money and use it to buy a house and leave it vacant? Now you're paying interest on top of everything else. Do you think wealthy people just light money on fire for no reason?

You rent out or naturally. If most buildings in a given area are rented out. Then the owners have leverage on the renters.

If there are more buildings than people who want to live in them, then the owners have no leverage. They have to compete for renters. You make that happen by building more housing.