I believe that the sort of law you describe would be state-specific; probably the only way you run into trouble here is if in your advertising to that one group, you suggest that any business from other groups is unwanted or unwelcome.Aren't there accommodation laws that state you can't advertise for business from one defined group? Suppose this lawyer advertised that he specialized in divorce for white people?
A lawyer that claimed to "specialize in divorce for white people" might run into trouble if there is no reason to believe that divorcing white people requires any sort of specialization, as one might conclude that the only purpose is to dissuade people of other races from seeking your services (e.g. "we specialize in performing car repairs for white people"). This guy should be fine, so long as it can be argued that there is something different about gay divorces that someone could actually specialize in.