I would as we live here, my DD is Spanish and at school here, but had my DH not been Spanish, no. I wouldn't. It's hard these days here. They are really stamping down. NHS equivalent will be impossible for you to get.
The house is in my name, DH has the 'usofructo' this means basically, that he has the right to live there until he dies, but it is my house and I won't therefore pay HUGE amounts of inheritance tax if he dies before me. (He is 18 years older than me, although I am far less fit!)
You might want to look into that. If you both own it, one of you will pay inheritance tax. In Spain, you, as a wife or DH will automatically by law inherit half to 3/4 of the house. The rest goes to DC's. It is nothing like the UK and also depends upon where you live. You have no say in this. (which is some ways is good)
I would have it in one name, good idea, with you as 'usofructo' ie the right to live there till you die. You will inherit either half or 3/4 anyway, DC's or other relatives the rest. It is all complicated and obvs you would see a lawyer.
What province are you in? (I am in Valencia where inheritance tax is awful)
Basically, you would have to make a will anyway, so check out the situation in the province you want to buy in. Ask questions (horrible) like 'if I die first and it's in DH/DW's name and I have usofructo what will happen? Seem like you know about this from the get go.
I have read horror stories about a DH having to pay huge amounts to pay tax on the DW's share of the house and barely being able to afford to. As it was in both names.
All of this changes all the time and also from province to province so check, check, check! Also make sure you trust your lawyer a lot. What I am saying could all change tomorrow and I am no lawyer. This is part of my insecurity living here. Every lawyer tells you something different.
On the whole, good to have it in one persons name IMO. You as usofucto, you can never be thrown out and will inherit anyway, I'd just ask about inheritance tax. All I have said applies to where I live, at the moment!