It is entirely within the realm of possibilities of course. You could have a government agency, like the SEC for example, that is funded by a fee placed on bond trades, and whose purpose is to rate debt instruments.
http://www.sec.gov/news/pressrelease/2015-8.html
You'd have to have very strong statutory safeguards against conflicts of interest and corruption. But any you had would likely be far more than the for profit rating industry has in place.
Politically such a move could be wildly popular among the banking industry that would salivate over presumed lower rating fees and that would pocket the difference, or try to; but it might make the corporate and venture capital world nervous. Government debt, as we have seen, is already de facto rated by the international market, and foreign central banks. When S&P dropped its rating on U.S. Treasury bonds, it was front page news everywhere, but after the dust settled made not one wit of difference, because S&P does not determine the market for U.S. debt. That is determined by other factors, which the S&P hopes to mirror with their own government debt rating.
It is important to note, perhaps, that the SEC is funded by appropriation rather than fees, but the fees it collects for the federal government have, typically, well exceeded its appropriation. In the meantime, the SEC may be somewhat underfunded. A cynical person might think this is how congress likes it to be, and conclude they don't want the SEC interfering with business profits by going after securities fraud anymore than they want the EPA, for example, to interfere with business profits. If you limit SEC funding, you limit the number of lawyers, and securities investigators they can hire!