A spokesman for the local government of Bornheim said on Friday that the ban on male asylum seekers above the age of 18 came after six people filed complaints "over the sexually offensive behaviour of some migrant men at the pool".
The measure aimed at "making it clear to the men that the rights of women in Germany is inviolable", he added.
Officials have gone personally to three asylum seeker shelters near the pools to deliver news of the ban and emphasize how people should behave in swimming pools, said the spokesman.
The town, situated on the west bank of the Rhine River, would revoke the ban once it deems that the message has been drilled into the asylum seekers, he said, adding that this would be evaluated through interviews with social workers at the shelters.
Authorities denied placing entire groups of people under suspicion, but said the measure was aimed at laying down clear ground rules.
Munich pools issue ground rules for migrants
Meanwhile in Bavaria, swimming pools have issued leaflets with simple pictorial instructions on behaviour for migrants who may never have swum in public before.
The leaflets are available in multiple languages, including Arabic, French, Pashto and Somali, and include safety and behaviour tips in a comic book style.
A leaflet produced by Munich city authorities including behaviour rules for migrants in the swimming pool. Photo: DPA
Particular emphasis is placed on stopping physical and verbal harassment of women, with images showing a red "no" symbol over an outstretched hand reaching for a woman in a bikini.
A Munich city spokesman told DPA that officials conceived the leaflets in 2013 after increasing numbers of problems in the city's 18 public swimming pools.
"The ground rule of respect for women – whatever clothing they're wearing – is unfortunately not respected by all our swimmers. That's why there is an explicit indication about it," the spokesman said.
Public disquiet growing in Germany
Public distrust of asylum seekers has grown in Germany after it emerged that hundreds of women were groped and robbed in a throng of mostly Arab and North African men during New Year's festivities in Cologne.
Story continues below…
An opinion poll for public television ARD found that 48 percent of respondents said they were afraid of refugees, while 50 percent said they did not feel that way.
A separate poll for public broadcaster ZDF also found that seven in ten people fear that a record influx of asylum seekers will lead to more crime, compared to 62 percent in October.
Germany took in 1.1 million asylum seekers in 2015, mostly from Syria, Afghanistan and Iraq.