The simple answer lies in the fact that Don John is a bastard, and as such can't be eligible for the same kinds of honors or recognition as his brother, who is of legitimate birth. Even though Don Pedro doesn't outwardly treat Don John cruelly, Don John is very aware that he is seen as socially inferior, perhaps even morally inferior, to Don Pedro. But this is only the most obvious answer.
Another potential answer lies in how this character's dialogue is portrayed on stage or screen. Since the dialogue doesn't seem to contain any specific animosity aimed at Don John, thereby making it hard to justify his bad behavior if others are generally pleasant to him, it is up to actors to find the subtext to turn this character into someone capable of behaving in the way he does. But if actors are directed to behave negatively towards Don John (through gesture, facial expression and so on), this can create a context to support Don John's reputation, regardless of the seeming lack of exposition. It can also be assumed that Don John may be a generally misanthropic person. He may also be bitter because of his brother's relative popularity and good nature, perhaps finding it difficult to be as sociable and friendly. Maybe Don John is simply shy and/or socially awkward and resents how easy it is for his brother to be successful. The key aspects to Don John's nature are resentment and bitterness; but since the text doesn't tell us exactly why he feels hat way or what happened to create his animosity, the key is in the choices made by actors in creating the character. Go over the dialogue carefully and find examples of how neutral dialogue could be interpreted as mean-spirited or bitter, given this context.