A judge has berated a 22-year-old man for his part in an “appalling” drunken homophobic assault on two innocent people in the street.