No, you make more money exporting value-added products (like olive oil) than raw ingredients (like olives). Basic economics says you want to move higher up the value chain, and that's what (I'm told) they did.
Of course this caused further problems for Greece and Italy, which were already not in good shape.
Your facts may be right (I don't know) but if so, Spanish authorities made a basic economic error in that decision.