The example you gave shows exactly how loans taken from the bank or from family and friends is being put to good and proper use.
Good debt and bad debt? You don’t have bad debts as a borrower, you incur bad debts as a lender giving out loans that won’t be paid back. That’s bad debt.
Loans are majorly taken out to help solve an emergency or for business purposes. If you end up spending the loan on irrelevant things, that’s a choice purposefully made knowing the loan has to be paid back.