I never said he was breaking the law.
The man is breaking a contract, which, if violated, allows for specific penalties.
And the courts, as in this case, are being used to enforce a contract.
An HOA may disallow the man to run a business out of his home, even though he is legally allowed to own a business. But when he purchased property in that neighborhood, he agreed that he would not do it.
It is the violation of a contract, not a violation of the law.