I got recommended at least two feet between hives and that they should be further apart when installing new packages to help prevent absconding.
Really hives can be right next to each other but they would be a real bugger to work on. A couple of feet would make handling the hives much easier if you have the room. As for packages, I have just handled them like a standard hive with no obvious problems but giving them extra room would not hurt in the beginning. You could move them into their final position when they are established.
It is likely just for your own ease of inspecting as a new beekeeper, being able to move around the hives. There can also be some drift if a colony has a new queen, and the bees haven’t fully familiarised themselves with the queens pheromone, should the entrances be right next to each other.