I can't think of a law that would allow landlords to enforce that in a rental contract. Renting is heavily regulated in Germany.
Consumption is different, but the new law is very specific in what is allowed and what isn't, and an unconditional ban is unlawful, as is already the case with cigarettes.