Anecdotal, but when I was looking for my first apartment about ten years ago I toured a building that didn't allow residents to keep alcohol. Unsure if it's even legal (or enforced), but the landlord and property manager were a local pastor and his wife.
How is it illegal? If the terms are on the lease, and you agreed to them, then it's no different than any other business contract. What law prevents a landlord from making that one of the terms?
Unless it is a shared dwelling where you sign the agreement in statement that you cannot drink alcohol due to some underlying mutually agreed reason, no tenant can be prohibited from consuming alcohol in their OWN dwelling space. What you do in your home is your business and no landlord can prohibit anyone from drinking alcohol, period.
Even if you sign the agreement on a lease or rental saying you will not, it would not be enforceable in a court of law and the landlord can be sued for cancellation of the contract for attempting to infringe on your personal rights (religious or otherwise).