It was probably like Vegas, it's a "wink wink" situation. Prostitution is not legal in Nevada in any counties with populations higher than 100,000, so pretty much anywhere besides Las Vegas and Reno, you're good. But that doesn't stop many people in those counties from not only providing the services, but having buildings dedicated for the purpose of doing so. The local government knows what is going on, but they also know that the allure of prostitution does bring people in to the city, and get them spending money on other goods and services which can be taxed, after which, the pros are obviously spending more money in the city which can be taxed. They bust just enough people to make it look as though they are attempting to "curb the problem", but they know it's beneficial to them, so why would they really try harder?
Two related legal examples are Asian massage parlors and swinger's clubs. Swingers clubs are not legal, but they get away with it by licensing them as "health spas". Everybody knows what they're really for, including the police, DAs, and judges, but these places are also huge revenue generators due to their legal status. Massage parlors can get away with charging people for hand jobs and happy endings because because technically, a full-body massage can legally include the penis, and if the govt can get away with letting something get taxed however they can, they will. Streetwalkers and the occasional call girl are the only ones who get pinched for prostitution on a regular basis here. Very rarely do they go after one of the established, loopholed places.
So my guess would be that Germany is the same way, they knew that the red light districts were there and operating, but they also knew that those districts made money for their cities and the country, so they either turned a blind eye to it, or exploited legal loopholes to let them continue. If any critics say anything, they police et al can just throw out the word epidemic a few times and say "we're doing the best we can with limited funding, maybe you should give us more money".