But when they die the basis for the capital gain is the value at the time of death, not the original value, so you basically sidestep capital gains taxation, your children or spouse pay back the loan and get a ton more money than they would otherwise.
I'm not an expert on taxation, but this is something people have been complaining about for a long time.