It’s an interesting question, and it’s coming up in New Jersey. I’ve often heard of homeowners associations banning signage, or dictating what color you paint your house. But can they ban guns, or otherwise infringe on civil liberties? There’s quite a lot of confusion about how civil rights law is applied within the gun rights community, but it seems to me you might be able to sue the homeowners association under 18 USC 1595, which provides for civil action against violators of the Civil Rights Act, namely 18 USC 241, conspiracy against rights. Civil Rights Law isn’t something I’m an expert on, so maybe this isn’t actionable, but unlike pure advocacy against gun rights, which is not considered a legal conspiracy, actually preventing people, or conspiring to prevent people, from exercising a constitutional right would seem to be to be unlawful activity under the Civil Rights Act, and subject to civil as well as criminal penalties.
UPDATE: Thinking about it more, if you were a prospective homeowner, coming into an association that banned guns, you probably don’t have a case, because you willingly agreed to surrender your rights. If you were an existing homeowner within an association, and that association votes to ban guns, I think you may have a case. You may have contracted to abide by the dictates of the homeowners association when you bought the house, but I think a reasonable argument could be made that can’t extend so far as to deprive one of constitutional rights.