They know the drugs will be sold anyways so the logic is to restrain it to a specific place. In Berlin one of them is Gorlitzer Park, the police is circling the park all the time to avoid crimes (other than selling drugs)
It's not really a problem these days since you can order all kind of drugs (anything from weed to coke) from signal/telegram groups and get them delivered to your door, sometimes faster than food deliveries