It's clear that Lister & Rimmer get on each others' nerves throughout the majority of Red Dwarf.
The question then is, why did they sleep in the same quarters when all of the other living quarters in the ship (including the captain's!) are now vacant? Aside from the episode Me^2 where Rimmer moves in with Rimmer for a short time, they live together and tolerate each other. And even that episode shows Lister happy to be on his own, being able to squeeze the toothpaste tube from the middle and so forth. But Lister could move out at any time and not have to put up with Rimmer any more.
We know that Holly brought Rimmer back as a hologram because he thought he was the best person to stop Lister from going crazy, but he couldn't have predicted they would choose to spend so much time together considering they hated each other before the accident.
We also know, or at least suppose, that deep down they would both probably get a bit lonely on their own, but there doesn't seem to be an acknowledgement of this by the characters themselves.