First, note that in many translations the term "music" is used to translate "mousike" , the arts governed by the Muses, which can include poetry, literature, and other arts as well as what English speakers call "music." Not all translations do this but the question does not specify a translation.
Justice for Plato was grounded in its effect on the soul of the individual. For Plato, this meant that achieving a just society depended on shaping a social system that would lead to justice residing in the souls of citizens. He considered (as is explained at length in Gorgias) that committing an injustice actually harmed the soul more than suffering one.
Music, for Plato, influenced the soul by stirring up emotions. Many modes of music thus could have a harmful effect on the soul by causing the emotions, part of the body and lower part of the soul, to overcome the soul's rational nature. Since it is through the rational part of the soul that humans are connected to the divine, this has a deleterious effect on the nature of the soul and a person's future life.
Thus, in the Republic, Plato recommends strictly regulating music in the English sense. He also broadly recommends regulating "mousike" in the broader Greek sense as well due to his theory of imitation.