Isn't it a greater risk to buy bonds when the government is in debt?
Government will never default, they would just print some money to pay back the debt, so the risk of default is almost 0
Many investors have so much money that they don't even bother risk it, even a small interest will give them millions of dollars of income per year. And typically it is the central bank who buy large amount of government bonds to adjust the money supply