Schools play a key role in transmitting attitudes towards sexual diversity. Many studies stress the importance of teachers' and other professionals' attitudes towards gay men and/or lesbian women. This study evaluates attitudes and prejudices toward homosexuality in a sample of 254 elementary and high school teachers in Barcelona and its surrounding area. The results obtained using a scale of overt and subtle prejudice and a scale of perceived discrepancy of values indicate that discrepancy between likely behavior and personal values was significantly greater in women, those who hold religious beliefs, churchgoers and people without any gay or lesbian acquaintances. Approximately 88% of the teachers showed no type of prejudiced attitudes towards gay men and lesbian women. The experience of proximity to gay men and/or lesbian women reduces not only the discrepancy between personal values and likely behavior but also the presence of homophobic prejudice. It would be advisable to expand specific teacher training in the subject of sexual diversity in order to reduce prejudicial attitudes, thus fostering non-stereotyped knowledge of homosexuality.