If you borrow money to buy an asset that depreciates, this is bad debt, and you should avoid it. If you borrow money to buy an asset that appreciates, this is good debt.This is crap. One reason is because it's very difficult to actually know whether an asset will appreciate or depreciate. For example, most investors who purchased subprime securities before the GFC wrongly assumed house prices only went up. As a result, borrowing money to buy an asset really only magnifies risk because, if the asset goes down, you lose more.
Another reason why this rule is crap is because it completely ignores the cost of borrowing, the cost of holding the asset, as well as whether the asset generates any income.
For example, suppose you borrow money from a loan shark at 20% in order to buy a house and assume that this house appreciates at 5% per year. You will actually be worse off than if you took out a car loan at 8% and purchased a car that depreciates at only 1% per year. In other words, if the cost of borrowing is so high, it doesn't really matter if the asset appreciates or not.
Some assets may appreciate over time but have extremely high costs. For example, suppose you purchased a run-down apartment that needs constant maintenance. As the landlord you need to fix the showers, clean the walls, replace the tiles, put more concrete on the driveway, and so forth. You may purchase an apartment that appreciates at a mere, say, 1% per year but if it costs you $1,000,000 per year to maintain this apartment, what is the point? These holding costs aren't necessarily in the form of fixing showers and tiles but may include council rates, land taxes, and other taxes or fees.
Another factor ignored when focusing only on asset price changes is the income-producing potential of the asset. If you take out a margin loan with your bank and borrow money at 8% to invest in shares of a company whose stock price depreciates at 1% per annum but it has a dividend yield of 10% then you are better off than someone who takes out a mortgage and borrows at 6% to invest in a house that appreciates at 3% per year and pays rental yield of only 3%.
In summary, if you borrow money to buy an asset, you need to look at a lot more than asset price changes. You need to look at everything that influences on costs and benefits. The idea that borrowing money to invest is a good idea simply because you expect the price of the asset to rise is thoroughly refuted in the examples above. Other things to consider include holding costs, costs of borrowing, and how much income the asset produces.