The National Institute for Hygiene and Safety at Work, in compliance with the Royal Decree 485/1997 and the Law to Prevent Risks at Work, both dealing with minimum requisites to ensure safety and health at workplaces, states a temperature between 17 and 27 degrees Celsius for work executed in an office, and 14 to 25 degrees Celsius in workplaces where they realise light work.
Employers should ensure these requisites are met. If your workplace doesn´t, you can report this with the Inspección de Trabajo y Seguridad Social, or a Union in your area. CCOO and UGT are big unions in Spain. You can find a listing of offices on their respective websites.
If it´s a big company, with the ´Delegado or Delegada de Prevención´ who must make sure the employer complies with the law.