No you do not have to purchase insurances in Spain. You can check around the EU and see what is the best deal for you. This includes insurances for: vehicles, house, life and much more. The only insurances you cannot purchase this way is social security and statutory pension rights.
The companies who sell these insurances must clarify who they are such as insurance company, brokers etc.
When you buy from an insurer in another EU country, the authorities responsible for regulating insurance in that country and in your own country will share information on:
the level of risk involved in the insurance you plan to buy
the insurer’s solvency
the types of risk for which the insurer is authorised in the country where it is based.
Information provided by the European Union.