Sure, AIG had to cover the real losses for premiums paid by companies that were actually holding paper on mortgage bonds, but the point I'm making is that many banks and hedge funds bought CDS' not to insure their own investments, but to bet against other people's investments. Those folks don't lose anything except the premium they paid for the bet when people don't pay their mortgages.
I think the problem is that you may have good reason for buying insurance on debt that you don't own, if you believe that the performance of that debt is correlated with something you do invest in. Imagine, for example, you invest in a mall in Florida. The revenue of that mall is going to depend on how well-off the residents there are. Residents defaulting on their mortgages would be a good sign that they're not going to spend money at the mall either - so if you want to prevent huge losses on your mall, you might want to buy insurance against their debt. That would be a nightmare to unravel, especially given that there's not even a public market for most of these products (i.e. they're not traded on something like the New York Stock Exchange). So there's really no way of knowing who owns what, much less why they bought things or from whom.
More fundamentally, however, you can't have the government deciding who invested in a product for "legitimate" reasons and who just speculated. Ultimately, there's a speculator at one end of every transaction: someone needs to hedge a risk and someone else is willing to put up their assets in the expectation that they pay out less in claims than they collect in premiums and fees.