You are allowed to vape in Spain, there is no specific law about it, it is simply not regulated, as in many, if not most of the countrys in the world. In public places, bars restaurants it is forbidden to smoke. If you want to vape, you must have permission from the manager of the establishment. So far, all the restaurants and bars where I asked the waiter, if I may vape, allways gave me permission to do so, stating that it isn´t forbidden by law.