Hi
As in the UK, definately require buildings insurance when a mortgage is held - the bank in Spain also request they are first named as benefactor and need to see any policy you intend to take out which is not with them for them to confirm it meets their requirements.
This is in the event of a deteriation in the property due to insurance related matters - ultimately they have a interest in the property until such time as their mortgage is redeemed.
I recently placed a post regarding buildings and contents insurance relating to the notice period required etc. You basically need to be 3 months in advance/prepared if you intend to switch with them.
Hope the above helps.