Because a debt to GDP ratio is usually the wrong metric.
The terms "first world" and "third world" are imprecise and not unproblematic for other reason, but they typically correspond to "wealthy" and "not wealthy." As such, the question seems to be asking why many countries are considered wealthy despite their high debt.
For instance, consider the United States of America. It is widely considered to have a high debt to GDP ratio of over 100%—not the highest in the world, but it is quite high. If absolute foreign debt or a debt-to-GDP ratio captured what we meant by a wealthy country, the USA would be considered quite poor.
However, consider a hypothetical wealthy CEO who has billions of dollars. Let's say that in their current job, they "only" make as much money as Lisa Su, a trifling 50 or 60 million dollars per year, but they own an enormous mansion that they have taken out a mortgage on, so they owe the bank 70 million. Are they poorer than I (not a billionaire) am, if I do not have any debt at the moment? Why am I not living a mansion, then?
No, of course they are not. We have made the mistake of considering the ratio of their debt to their income without considering their tremendous wealth. We have also forgotten that what matters for their ability to use their wealth is the absolute difference between their wealth and mine, not so much the ratio of their debt relative to their wealth.
Let's consider the total debt to total household wealth ratio of the United States instead. According to this article, it is about 12%. Much of that is internal (owed by Americans to Americans) but even if it were all external, the difference between debt and wealth would still be around USD 124 trillion. That means that as a country, the US has about USD 123 trillion more than Kuwait, for instance, even though Kuwait has quite a low debt to GDP ratio. For another definition of wealth vs debt (the average economic standard of living as measured by debt minus wealth per capita) we see that the average American has USD 376,000 or so after subtracting debts, whereas the average Kuwaiti has USD 119,000 at most. Obviously, this has its own problems: it does not take into account income inequality or purchasing power parity. However, it still conveys the general idea: one country can have both a higher absolute debt and a higher relative debt than another, and its residents can (both individually and collectively) have much more money to spend after subtracting their debts.
Going back to the example of the CEO, why do they have so much more debt than I do, both in absolute and relative terms? It is because their enormous wealth and substantial income make banks view them as more trustworthy. If I tried to take out such a large loan, the bank would laugh me out of their exclusive boardroom (which I actually would not be invited to in the first place). They would know that I could never pay off such a debt over my entire lifetime. However, they know that the CEO will be able to do so.
As such, wealthier people (if they want to expand their ability to consume still more) get more debt in absolute and sometimes relative terms because they can. The same applies to countries, to an extent, with a major exception: a low-income person might take on student loans or housing mortgages that exceed their real or expected wealth (in other words, low in absolute terms but high in relative terms), which the companies will give them because they anticipate that the interest payments will make it worthwhile. A country, however, has much more power to default, and it can be difficult for politicians to convince their constituents to take on large relative debts if they know that they will not be able to pay them off under any circumstances. This means that low-wealth countries rarely take on more relative debt than the average wealthy country.