In a lot of places, mortgage payments are around the same as rent, so if you can "buy" (qualify for a good mortgage) you'll be paying less AND your net worth will be growing
Of course, the situation is more complicated in areas like the SF Bay and Seattle. Housing prices vs rent basically assume 5% year over year growth forever, so if you think housing prices will be flat, it's economically advantageous to rent
There's a good calculator without a ton of BS here on this old page: https://michaelbluejay.com/house/rentvsbuy.html