one reason would be these fish can be territorial towards their own kind, so it is wise to keep them in pairs rather than as a group predominated by one sex. If you keep them as a group, provide lots of foliage. so even in pairs they can be terratorial and a 2.5 gallon soes not provide enough space to create territorys.
I also believe cherry barbs like to swim and in a 2.5 gallon there is not alot of room to have a decent swim
because the tank is too small for active schooling fish...not to mention putting 5-9" of fish in a 2.5 gallon tank that can't be cycled is ridiculous...you didn't even think about that?