Social learning - Police officers grew up in an environment whereby gays and lesbian were view by the society as extremist militant types and therefore they grew up with that perception in mind and when the join police, they still have the same perception which lacks basis.
Labeling - This has been as a result whereby the police officers just label them that way and this behavior which is a pure stereotype has been there since. When the new police are recruited, they also adapt the system and just view gays and lesbians as extremist militant types.
Society perception - most of the people in the society views gays and lesbians
as extremist since they are actually few or very few in the society and thus police officers will also have to view them as extremist with no basis why they view them as extremists.
Beliefs - There is a strong belief among the police officers and most people that, gays and lesbians are actually not normal and hence are associated with bad things yet in reality, that is not the case but just a belief that is being passed from one generation to another without any basis to proof them as so.
In conclusion, learning something is much easy but unlearning it is the greatest challenge. This is the reason why police officers through beliefs, social learning, society perception and labeling have learned that gays and lesbians are viewed as extremist and they still hold such baseless perception because it is hard for them to unlearn it.