Matthew Yglesias discusses a simplified model of mortgage based structured financial products (CDOs and CDOs2) posted by Alex Tabarrok taken from a book by Robert Pozen. The model shows how structured finance can transform a collection of moderately risky mortgages into securities some of which are intended to be quite safe and others of which are intended to be quite risky by assigning defaults to the risky securities first. Not surprisingly if defaults turn out to be higher than expected some of the "safe" securities can prove risky.
Yglesias says "Importantly, this is not a scam. The math really checks out. ...". The math may check out but I think it is largely besides the point and these products were essentially scams. The main incentive for making financial products complicated is to make them hard to value and thus easier to sell for more than they are worth. Here the optimistic model assumptions which led to these securities being overvalued were not some unfortunate accident but a necessary part of the scheme. There is in fact no compelling reason to reassign the risk of defaults in this way. So if the complicated structured finance securities were valued correctly they would not be worth more than simple pools of their component mortgages meaning there would be no incentive to create them.