Banks will not loan you money to put it into the S&P. The wealthy generate money by generating credit in part.
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?
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...