Because german banks have been benefiting from the usurious interest rates being charged to the southern european countries. If Greece defaults several german banks go bankrupt.
True, but what sane bank would take on the risk (=higher interest) without knowing that it is worth it? So I assume there was some background deal, an assumption that governments will cover for defaults.
The banks take this risk not just because they expect that there will be a bailout but also because the Basel Accords allow them to treat sovereign bonds as riskless when calculating their Capital Adequacy Ratio, making those bonds look like a better deal relative to other bonds of equal risk.