A mortgage on a second home is often not tax deductible due to the mortgage balance on the primary home. But that doesn’t mean you can’t benefit from borrowing, instead, from yourself. By selling some of your liquid securities to purchase your second home, and then borrowing to buy back those securities, you are able to benefit from the investment interest deduction. The interest you pay to buy that investment is tax deductible. Assuming minimal gain can be recognized on the investment sale, you will benefit by the amount of the annual tax savings.
Never borrow to purchase personal items if you can borrow against investments and make your interest tax deductible.