Multiple factors matter and the correct answer isn't always obvious
Which parties are necessary in an action related to HOAs is often a tricky question (even for smart judges trying to do the right thing) and I have seen cases where the trial court says one thing, an intermediate appellate court rules another way, and the state supreme court agrees with one or the other for reasons different than those given by any of the lower courts.
From a litigant's perspective, the better choice is usually to err on joining too many people, which is almost harmless error if they aren't necessary parties, rather than to joint too few people (which can often lead to reversal of a case which may have been correctly decided on the merits).
Some of the main factors are reviewed below.
What remedy is sought?
Part of the answer hinges upon the remedy being sought.
If the suing HOA member sues for a declaratory judgment that allowing this was improper and a prospectively enforceable injunction, the individual HOA members are probably not necessary parties. Is the person suing seeking an order to tear down the decks? To impose a fine? For some injury suffered by another HOA member in the form of reduced property values?
One bright line rule is that anyone against whom relief is sought, directly or indirectly, is generally a necessary party, so the nature of the claim brought and the relief sought are critical to evaluating who is a necessary party.
If the relief sought is to have a deck removed, the owner of the property served by that deck almost certainly has to be made a party.
Even this rule has exceptions, however, in cases where a named defendant fairly represents the interests of the unnamed defendants in some cases.
For example, the beneficiaries of a trust owning a unit don't have to be named as parties if the trust is named as a party.
Relief in the form of a money judgment against a defendant almost always requires that defendant to be joined as a party. Relief "in rem" limited to recovery involving a particular identified piece of property sometimes can proceed with fewer parties if notice by publication is given to potentially interested parties.
Who owns the common areas?
In some HOAs, all members have a present, undivided tenants-in-common co-ownership interest in the common areas, while in others, the common areas are owned by the HOA and the members of the HOA don't have a property interest in the common areas.
This arcane and technical issue could be outcome determinative on a necessary parties question. If the common areas are owned as tenants-in-common, all members of the HOA may be necessary parties.
Who has permission to enforce covenant violations and is this a covenant violation?
Who has standing to complain about the failure of a homeowner to comply with the covenants in the governing documents?
Some HOA governing documents limit this authority to the HOA only, others allow either the HOA or any HOA member to enforce covenant violations.
In other words, some HOA governing documents allow Bob to sue Sally directly, without even naming the HOA as a party, for some kinds of covenant violations. Others authorize only the HOA to sue Sally.
But if the problem is that the HOA approved something that it shouldn't have approved, it isn't necessary a covenant violation, even though it seems to be one on its face.
Statute of limitations issues
Related to who can sue, is the issue of statute of limitations.
In Colorado, where I practice law, and in many other states, there is a short statute of limitations (one year) within which you can sue to assert that a completed structure is built in violation of HOA covenants, and sometimes what triggers the statute of limitations will be different for a claim brought be the association (which may run from the date of the violation or from when it had notice) and for a claim brought by a homeowner (which can run from the date that an HOA member has notice of the violation).
Have HOA members or the HOA done something actionably wrong?
A common scheme in HOA governing documents is that someone must seek permission from an architectural control committee to make some kind of improvement, and if the architectural control committee fails to act within a certain amount of time, the proposal is deemed approved, even if it clearly violates some HOA policy or covenant.
In those cases, there is no valid claim of anyone against the offending deck building HOA member, and there isn't necessarily a claim against the HOA for negligently failing to enforce its covenants either.
The nature of the claim governs whether it runs with the land.
Sometimes the nature of the claim is that a particular owner at a particular time did something wrong for which they are responsible (e.g. allowed a dog off a leash that bit someone). Usually claims like that name only the owner who did something wrong.
Sometimes something related to whether the property can continue to be in the state it is will run with the land and apply to future owners, so will claims that are liens against the property (e.g. for unpaid assessments) that were perfected by the person imposing them prior to the sale and not cleared up at closing.
And, nothing prevents a single complaint filed in court from asserting more than one kind of claim.
The distinction is harder than it seems because the issue of whether an offense is particular to the person who committed it, or runs with the land, is often non-obvious and not well developed in case law or statutes.
Bottom line: It's complicated.
Because multiple aspects of the HOA governing documents and the precise nature of the relief sought in the case are so essential to determining who is or is not a necessary party to a lawsuit involving an alleged failure by the HOA to comply with its own policies, determining who is a necessary party isn't easy.
Far more facts are necessary to answer the question correctly.
Bonus question
If Harry illegally built a deck and then sold his condo unit to Sally,
does Sally own the deck and have a responsibility to maintain the deck
or is it the Association's responsibility?
This is highly dependent upon the definitions used and responsibilities created in the HOA governing documents. A lot will depend upon whether the governing documents treat this as a part of a unit, a limited common element, or a common element, but there is more to it than that. Even if it was built in violation of HOA policies, it may be a fait accompli at some point that is treated as valid.
There is not one consistent way to handle this issue that is predominant in HOA governing documents.