The notional amount of all outstanding credit default swap (CDS) contracts is estimated to approach the worldwide GDP. Part of the reason this figure is so high is that people can buy CDS contracts on debt they don't even own - it is common for the notional value of CDS contracts for some credit entity to exceed the total value of bonds issued by that entity. This implies people are using CDS contracts to speculate on a credit entity's risk of default, or even further, to profit from fluctuations in market expectations of credit risk. Does this mean the CDS market is just a glorified casino?
In theory, the CDS market allows risk to be spread among more participants in the economy. But when a CDS is bought by somebody who isn't actually exposed to the risk of the underlying debt, this clearly doesn't transfer any risk from buyer to seller - it is merely a zero-sum bet made by the two parties that actually creates previously nonexistent risk. Arguably, such a transaction generates no real wealth. In contrast, in the non-zero-sum exchange where the CDS buyer owns the underlying debt, both parties benefit: the buyer reduces his risk, the seller increases his risk in exchange for a premium, and the total amount of risk remains unchanged.
CDS speculators can still increase efficiency by 1) providing liquidity, and 2) by contributing to the process of price discovery. The additional liquidity provided by speculators allows more buyers and sellers to find one another. As a simple example, suppose I own some CDS contracts and would like to sell them now. A speculator, Bob, may buy these contracts from me and later resell them to Mary. I benefit, by getting a higher price for the contracts than I would have received from a nonspeculative buyer, and by not having to hold onto an asset I no longer want. Mary benefits, as she obtains an asset she wants at a price she feels is appropriate. And Bob benefits, we hope, by profiting from the difference in prices from when I sold to him versus when he sold to Mary.
When a CDS is bought by someone not exposed to the underlying risk, the transaction also contributes to the process of price discovery, and this benefits all people who DO actually bear the risk of the underlying debt, and probably others as well. If you assume that price discovery takes resources, it also means that others besides those who own the underlying debt can do the work of valuating this debt and be compensated for the work. This is efficient, and it's better than having a few anointed ratings companies rate debt. Clearly, ratings companies paid by those selling the debt do not have the proper incentives to rate it accurately.
In fact, in a public CDS market, a "ratings company" becomes just another market participant. Those skilled at evaluating risk would be able to profit in this market and could even start "CDS funds" that would attract capital from outside investors. Unlike current ratings companies who do not really bear the cost of poorly evaluating credit risk, these hypotetical CDS funds would literally thrive or go bankrupt based on their rating abilities. So, even if the CDS market is a casino, creating risk which did not previously exist, it at least gives participants a strong financial incentive to come to an accurate valuation of the underlying debt.
The problem with this story is that if CDS contracts aren't traded on a public exchange whose prices anyone can see, the benefits of the market's game of price discovery aren't realized by those on the outside. Why isn't there a public exchange for CDS contracts, anyway? According to the Wikipedia article, "In 2007 the Chicago Mercantile Exchange set up a federally regulated, exchange-based market to trade CDSs. So far, it hasn't worked because it's been boycotted by banks, which prefer to continue their trading privately."