The mortgage deduction does not apply to land. It applies to a home that you actually live in, and you are limited to two properties.
Real estate is a good investment mostly only in the case of owning your residence. Real estate as a way of making money has a lot of disadvantages. First, you need to buy homes are cheap and interest rates are low, This seems to occur maybe for a couple of years every decade. Then you need to sell, preferably without as broker, when home values are high and interest rates are low. This happens even less often.
The best way to make money in real estate is to invest in mutual funds that specialize in it, or in what are called REITS (real estate investment trusts).
If you have your money tied up in a house and need the money, it can take rather a long time to sell it, and odds are you will need to use a broker, which will eat up a lot of your profit. If you rent a house, there is always the problem of maintenance. The lights go out, the toilet backs up, the furnace stops working, the AC goes out.You must time your rental contract to what your anticipated needs might be.
The REITs and the RE mutual funds are far better. They invest in commercial real estate, and all you need to do to get your money out is to tell the brokerage: "get me $x", and within three days they do, and you have a check within a week at the most. No mutual fund ever flushed a hairbrush down the toilet.