You are mistaking owning US debt and having your debt denominated in dollars. Many foreign countries find it desirable to own US treasuries, but they don't want to borrow dollars and have a dollar-denominated debt. When that happens, and your own currency is devalued, you still owe the same number of dollars. You now have to buy these more expensive dollars to repay your dollar-denominated debt.