The condition, pseudofolliculitis barbae, primarily affects black men and can cause severe irritation, rashes and ingrown hair.
Houston police said the ban was adopted in 2005 because officers with facial hair cannot properly seal gas masks in the event of bioterrorism attacks.
The lawsuit filed Tuesday says the men were reassigned to plainclothes duty because of their facial hair. Sgts. Shelby Stewart and Kenneth Perkins said they have goatees because of the skin condition.
"When they took us out of uniform and told us we couldn't work second jobs in uniform, that meant that we had to take a financial hit that most officers would not take," said Stewart, a 26-year department veteran.
Craig Ferrell, a lawyer for Houston police, denied any discrimination but said the policy will be changed. Officers who cannot shave would use special gas masks that that can be worn over a beard, he said.
Officers Adrian White and Raul Collins are also plaintiffs in the lawsuit. The City of Houston is also named as a defendant.
The lawsuit alleges diminished status and pay because of the policy, but Ferrell said the reassignments were not demotions.