State lawmakers passed the law after a North Texas homeowners’ association banned landlords from renting to Section 8 tenants. Most of the affected renters in that neighborhood were Black.