Thanks for the chance to help. I am an attorney with over 12 years experience. Hopefully I can help you with your legal question.
Sure...that would be legal, IF....and this is the key....IF they bylaws of the HOA
provide for this.
An HOA is, in many ways, like a small city. It is able to set its own rules.
So long as the rules do not violate state or federal law, the HOA can enforce the rules.
Now, it is not legal to discriminate based on a protected status like race, gender, religion, or disability.
But discriminating based on criminal record is not illegal.
In the case you describe, the HOA could discriminate based on criminal record of prospective residents.
But this can only happen if it is contained in the bylaws of the HOA. This is not something that the HOA board can arbitrarily impose.