Earlier quoted context omitted.
Didn't Greece falsify data for years? That would explain the AAA ratings.
Were the banks truly deceived, or just hoping that they could cash in and be bailed out?
Apart from the AAA rating, government bonds also had a very low risk rating in the Basel accords (Basel I, and Basel II that just came into effect during the global financial crisis 2008).
Basically, the Basel accords specify a minimum capital adequacy ratio, that is a certain minimum capital level to support given risk weighted assets. (Capital in the bank context basically refers to equity - i.e. funding that can absorb losses without the bank going bankrupt due to debt obligations they cannot fulfil.)
Now, the risk weight for government bonds is zero! (in Basel II, they had to be AA or AAA, and it gets complicated quick, but basically...) So you can load up on them without having to increase your equity cushion.
2. This allowed banks to increase their Return on Equity, which influenced bankers' pay.
3. Furthermore, I think they were all implicitly banking on either bailouts (directed at individual banks) or a version of "The EU would never allow a member government to go bust".
So, I think everyone was in it to an extent (while formally "correct" and "safe"), cashing out merrily, and hoping for the best.
Another great book on this, by the way, is The Bankers' New Clothes: What's Wrong with Banking and What to Do about It by Anat Admati and Martin Hellwig.
(Funny side note: I searched "bankers new clothes" on Amazon to get the author names right, and got a page with dress shirts and briefcases.... :-)