They are unconstitutional because they are private contracts which are forced upon the purchaser.
You may be certain, but you’re legally wrong, and thousands of HOAs in every state prove you wrong.
Do you think a resrictive covenant would hold up if it stated you must be a life member of the NRA?