Purchasing property with covenants is extremely commonplace. If a person buys a condo (co-op) with a covenant that allows behavior within the condo to be regulated, then that’s the way it is. Look at some of the ridiculous rules that HOAs can apply to homeowners in a development. This is a totally feasible extrapolation of the same principle...
But in the case of the co-op, the co-op corporation owns the property, and you are only entitled to a proprietary lease linked to your shares. However, changing a proprietary lease can be tricky, and most co-op corporations try to avoid the trouble and expense.
This is why I live out in the county: less ‘rules’ for me!!