Article 512 [source]

Spanish Criminal Code
English translation

Those who, in the course of their professional or business activities, deny a person a benefit to which they are entitled on account of their ideology, religion or beliefs, their family situation, their ethnicity, race or nation, their national origin, their sex, age, sexual orientation or gender identity, gender-based reasons, aporophobia or social exclusion, the illness they suffer or their disability, will incur the penalty of special disqualification from the exercise of profession, trade, industry or commerce and special disqualification from educational profession or trade, in the teaching, sports and leisure field for a period of one to four years.