Why would a common currency such as the Euro that can't be devalued be incentive for banks to lend money to a country?
When you lend Spain 10 million Deutsche marks, the loan is denominated in a foreign currency: they have to return you 10 million Deutsche Marks (ignoring interest for the moment). But the Spanish earn their income in local currency. If in the meantime their local currency depreciates relative to the Deutsche Mark, the value of the repayment becomes greater in terms of the proportion of their income (which is in local currency) and their ability to repay becomes smaller.

If you lend them Euros and they receive their income in Euros, a devaluation doesn't affect the (local) value of the debt.