Another difference between the two, is that technically you "own" your Union membership as long as you're a dues payer in good standing, and you have access to all the benefits; representation, guaranteed pay, healthcare, etc. A non paying member is legally protected and "entitled" to the same in an RTW state.
In an HOA, you usually own the lot and house, but the HOA owns the community pool, clubhouse, park, hiking trails etc. Your fees pay for the upkeep on those things. I see no reason why an HOA couldn't just agree to bar you from those things if you chose not to join. They wouldn't however, because it would weaken the HOA overall, and there's no law forcing them to do so, as there is with RTW.