The core of the issue
As far as I can see, the most common cause of this issue is that the players don't feel the need to roleplay the sort of relationships you're after, because as far as they can tell, their characters have little reason to feel that way about each other. As DM, you can't tell the characters how to feel, but you can put them in situations that give rise to the feelings you want. In my experience, the strongest bonds are the ones the players build themselves. Here's a few ways to get them to do that.
Having a common enemy is a start, but the real trick is to guide the players and their characters to see their allies as valuable. A simple way to do this is to put the characters in situations that some of the party members are particularly equipped to deal with, so that those few really shine. Obviously, you'll want to have a few of these scenarios so that everyone gets their time in the spotlight. For example (using D&D 5e classes), one session you might have an enemy who inflicts a curse, and the paladin with the ability to remove curses can gain the gratitude of the barbarian who gets hit by the curse. The next session, you might have an enemy who can use mind control, and the barbarian who's immune to mind control while raging can come to the rescue and free the paladin from the spell. Both of them have now saved each other from something unpleasant, and therefore (hopefully) recognise each other's value and have some mutual gratitude and respect.
How to set this up depends on the party makeup, but in general you're looking for reasons for a player to turn to someone else's character for help, rather than their own - and put the spotlight on that character for a moment. Not so much that they feel like their own character is useless, but enough that they recognise the value of having friends.
Pieces of a puzzle
If your players like to build characters with a little backstory, then as a DM you can weave the world around these stories in ways that pull them all together. In D&D 5e, a character's Bond can be great for this - they're designed to act as built-in plot hooks. For example, the party cleric may be searching for a long-lost relic related to their deity, the rogue might aspire to be the greatest thief of all time, and the fighter may have stood up to the wrong person in the past who holds a grudge against them (all actual 5e Bonds). So, what if the lost relic was stolen by the thieves' guild, and the fighter angered a corrupt noble who was actually trying to assist the thieves' guild at the time? The rogue can use his criminal contacts to get them into the guild, and then prove he's the best of them all by stealing the relic from under their noses. The fighter can get his revenge on the corrupt noble by setting him up to take the blame for it and suffer the anger of the guild, and the cleric gets to keep the relic and return it to his monastery.
Depending on your setting, players, and story, this may be easier or harder to set up, but in general what you're looking for is ways to get the characters' individual stories to all point in the same direction, so that each character succeeds by helping to further someone else's story, which in turn furthers their own. Players are naturally attached to their own characters and stories. By giving characters a chance to play important parts in each other's stories, you can help your players to become attached to each other's characters as well.
When players work together, they're often more powerful than just the sum of the individuals in the party. Many systems give characters abilities that are designed to support or strengthen others - in D&D 5e, there are loads of spells designed to be cast on someone else to help them, and classes like the cleric, bard, paladin, and battle master fighter are built around mechanics that heal, strengthen, or support. Put your players in situations where simply fighting as a bunch of individuals isn't enough. This can be tricky, and in some cases can risk killing characters (or the whole party) if the players don't cotton on fast enough, but it's very rewarding for all involved when it works. When the fighter realises he's taking too much damage, you want him to turn to the cleric and ask for healing, and then next time they're gearing up for a fight he might ask the druid to cast stoneskin on him. A bard is particularly good at this, bestowing their bardic inspiration on allies in key spots to shift the tide of battle. If the players don't have to work together to overcome challenges, then the challenges aren't challenging enough.
In D&D 5e, you also have the inspiration mechanic to aid you. When a player goes above and beyond to help another, or puts themselves at risk to set someone else up for victory, award them inspiration. This reduces the perceived penalty in not just looking out for themselves - by helping someone else to succeed now, they get inspiration to help themself succeed later. Also, remind players that they can give their inspiration dice to another player if they see fit. Next time they're all willing one of the party to succeed and save them all, they'll be scrambling to give away their inspiration dice to boost their chances.
All in all, the central theme is that the party should be parts of a whole, not just several parties of one that happen to be going the same way. Between the plot, the characters' abilities and the party's resources, you have a good set of tools to build a campaign in which no player can succeed alone, but the party can, by joining forces, become more than they were apart. Do that, and your players will value each others' characters as much as they do their own. The roleplay of inter-character relationships will grow naturally from that.