Local authority involvement with a family in Leeds - which sparked a riot in the city - "was not, and never had been, about discrimination," a judge has told a family court.