1) They're very leery of whatever's Russia up to, and much of their NatGas comes from there. Any alternative energy is good energy.
2) It shores up the economy in a relatively stable part of northern Africa that'd be a prime location for people wanting to immigrate to spain. More refugees are not a good plan.
3) It helps Europe to hit Carbon reduction targets without having to deal with the NIMBY population.
Or at least it was a strategic thing. Reading some more, European investors pulled out, and it's the Africa Development Bank now. Maybe the money is too nuts even with strategic goals in mind.