How the hell is buying a home considered an investment?

Hello,

So, I am doing taxes and for the first time looking through my year end mortgage report - I'm absolutely astounded!

I paid $25k in mortgage interest last year, plus ~ $5k in property tax and insurance. I've only paid off $5k of the principal on the mortgage. So out of $35k I've really only invested $5k of it? The rest I might as well have thrown into the garbage? Am I missing something here?

Lets say my home is worth $500k. If it doubles to $1 mil over the 25 year term I will make an average of $20k profit on the "investment" per year. That doesnt even cover interest and tax/insurance!

Not only that, but by the time it reaches that value, value of all other property will have followed the same trend.

How in God's name is this considered an investment? Seems like it would make more sense to rent ... please tell me I am not understanding the math on this, because I just dont get it. I will be the first to tell you I dont know much about this stuff, but it seems like a complete racket.

Sincerely, confused.