An investment earns money. A house requires you to pay property taxes on it. A house requires that you buy electricity for it. A house requires that you pay for running water. A house requires that you buy cleaning supplies for it. A house requires that you fix the roof when it is leaking. A house requires you to pay all sorts of expenses on it the whole time you own it. I call that an expense not an asset.
A rental property is an investment because it earns an income. The house where you live has no attributes of an investment. The house where you live costs you money. It doesn't earn you money.
As a Realtor for over 40 years, I dispute your premise. If I rent the same house, I have no deduction for the mortgage interest which is usually what puts most people over the threshold so they can deduct dozens of other things. These are expenses one would have whether or not they own the house. You talk like I'm just handing someone $10,000 to save $2,500 on my taxes.
If I rent the same house, I still pay the taxes (included in the rent), electricity, water, cleaning supplies, mow the lawn all of which I have either way and are not deductible either way.
You also miss the fact that my investment is based on what I have invested not the purchase price of the house. A margin I can't get in the stock market. Say I buy a house for $300,000. I mortgage
$250,000 at 4% interest putting $50,000 down. Payments are $1,700. per month. Were I to rent the same house, my rent payments are going $3,000 per month. Of that $1,700 the first year $10,000 is a deduction plus taxes plus say $3,000 in property taxes.
I own the house for five years, I put in a new kitchen, carpet, paint, really spruce up the landscaping. Great neighborhood and I sell the house for $375,000 and net $350,000 meaning roughly a profit of $50,000 plus the $50,000 I put down so I made 100% profit. As my, or our house if I'm married, there are no taxes on the $50,000 profit so now I can put $100,000 down on the next house.
Using 1031 tax-free exchanges and good advisers a nice retirement portfolio can be put together.