One possibility is to use purchase-repurchase plan , that is available for instance from
www.auto-france.com (only brand new Peugeots), to buy a car in Spain.
This company will deliver to most major cities in europe, incl Madrid airport for car pick up, of course extra fee will apply, but is one way to take care of all the hassles , incl insurance, registration, and other paperwork.
I am ALMOST certain that this type of plan is available from Canada, maybe not via above mentioned company , there are many others that offer similiar service. I looked into this while still living in Canada, but it was over 10 years ago , and at least then this plan was offered.