Its a difficult one. We are often encouraged to keep animals in pairs so they won't be lonely but, in fact, if they are being kept in restricted living conditions they inevitably end up fighting. I think often the animals would be happier living alone as long as they get a lot of human contact and interaction. They are, after all, domesticated and no longer wild or living in their normal habitat. Its one of the reasons I like syrians - they have to be kept alone.
I see the rabbit rescues insisting on rabbits going in pairs and neutering them so that it is more likely to be successful. I used to breed rabbits for many, many years and I only ever had one pair of does who happily lived together. Of course, none of mine were neutered.
I've always found guinea pig sows are happy to live in groups but there is a very strong pecking order. I think they are better in groups than pairs. Males can also be kept in pairs but I have found this a bit more tricky, they don't exactly fight but can show symptoms of stress, mite outbreaks, etc. They need a decent size cage with room to get away from each other if they want.
I've never had any trouble keeping gerbils in same sex groups either but they did have massive fish tanks as their home.
My two-penn'orth!