Realestate in term of the house you live in is not an investment, it's generally a liability. However, rental properties are investments. Yes, generally there is a leverage play involved unless you pay cash (which you can down the road). Like any investment, doing it right or wrong obviously will affect the outcomes.
Realestate return in investment comes from 2 sources, appreciation and rental income. Appreciation, which the previous generations took great advantage off, can't no longer be counted on. But there are still ways to make out like a bandit if you know how to buy properties on the cheap. Fixer uppers, short sales, foreclosures etc. There is a lot to learn already. But how to make money on rent is even a bigger beast, I can listen to my old man can go on for half a day and barely scratch the surface. But that's still a smaller subject than how rental income.
Rental income is off-set by business expenses and depreciation on paper. (e.g mortgage interest, travel, supplies, repair, advertising, management fee, property tax...) Suffice to say what appears as barely making a profit or even a loss on paper, could actually be making good money. While the expenses tends to stay flat or go down, the rent tends to go up overtime (even when housing market tanks, and more people goes into renting). How to be a good/profitable landlord will fill volumes, the types of rental property, how to get manage tenants, legal, etc.. These can be a real headache if not done right. If you have a family member or relative who's a landlord will help.
P.S only NET profit from rent is taxed at your marginal tax rate, the sales of a rental property is taxed at capital gains rate.