mmmm, no. There was no "gamble" there. The banks were profiting handsomely from behavior that would eventually do them great harm. You also have to keep in mind that a corporation is not a person, no matter what the Supreme Court may think: a publicly traded company has a fiduciary obligation to its shareholders to maximize value and dividends. If Washington Mutual is making money hand over fist with CDS, there will be intense pressure on Wells Fargo to play the same game. And there was, and people lambasted Wells for staying clear of CDS, and analysts were mad, and the stock was punished, and then CDS exploded and everyone was all "huh. Wells Fargo. What a prescient company."
When you've got a corporation with 10,000 employees, eight divisions, 900 offices and presence on three continents, it's easy for one part of the company to do something terrible for the rest of the company. The CDS guys were making shit-tons of money while the mortgage departments were sowing dragon's teeth. My favorite irony was how hard WaMu lobbied to get the bankruptcy laws changed so that you couldn't Chapter 13 away your credit card debt. This was great for the credit card division because now they got lotsa money. Unfortunately everyone who couldn't pay their credit cards and their mortgage said "okay, fuck the mortgage then" and WaMu's $10k credit card debts got paid while their $250k mortgages did not.
And that's about when all the clever financial pundits start saying things like "hey, a mortgage is a contract. You agree to pay it, they agree not to take your house and trash your credit rating. You're going to lose the house anyway and is your credit rating really worth $4000 a month? Walk the fuck away." And all of a sudden the market starts talking about "moral hazard" and the banks start screaming for the return of debtor's prisons and the housing blogs start posting Slayer videos but at the end of the day, you shouldn't give money to someone who can't pay it back.
So, gambling? no. Self-absorbed self-interest? Absolutely.