Many factors.
I'm in a major city. Rents are crazy. In DC, rents are more than I pay in mortgage for half the space in similar neighborhoods. Even ignorin' the investment aspect, smart money says to buy somethin'.
But add the investment factor, I wouldn't consider another way. My home has increased in value by 68%. I could sell as is and walk away with mad paper. But I'll be puttin' some money in then sellin'. I'm into my house for much less than investors are payin' right now.
Folks say buy down south, but the profit is in line with the initial investment. If you're buyin' a forever home, cool. Enjoy the lower cost of livin'. But if you'll be sellin' in 5-10 years, it's just a smaller initial investment & smaller profit. And if you're in the burbs in the south, those are the areas that get hit the hardest when the market is down. Versus say, NYC where your value was at worst stagnent, in say 2008. We got a crib in Charlotte now that makes more sense to hold & rent than sell because the value is just gettin' back to purchase price. Who knows when we'll be able to unload.
And home ownership is the biggest wealth builder for lower & middle class folks. Major reason Black folks are hurtin'. But also the biggest investment for Blacks as we're less likely to invest in riskier assets like stocks.
Sure, money is bein' made over your head by the bank. But there's no reason not to invest just because the bank is also makin' money. Most every business has expenses where someone else is also gettin' paid. Banks pay the feds interest. Doesn't seem to hurt them. Just have to be smart & out pace the expenses.