There are several factors that makes MBS an attractive investment:
1) MBS has two type: agency and non-agency mortgage pools backed. The agency bakced has less credit risk than non-agency one, but has higher yield than US Treasury due to the credit risk; Thus, MBS is a better choice for investors who want to seek higher yields without taking too much risk.
2) CDO backed by MBS are tranched in capital structure. Investors who are risk-averse can buy senior and hedge funds are common buyers of equity tranch.
3) the bank who issued mortgage in first place is more focuing on earning the service spread;
Using a mortgage of $100k as an example, the mortgage is 30 year and rate is 6%. While 30 year T-bond is 4%, so typical CDO will look like following:
Bank: service spread 0.5%
Senior $80K yield at 4.5%;
Mezz. $15K yield at 5%;
Equity gets remaining value;
Hope it will help you to understand MBS!