Cold blooded animals still produce body heat, just like you feel warmer after exercise. They may not have any methods to keep their body temperature much higher than the surroundings, but wouldn’t want to become too cold either.
Edit:
While many snakes hibernate in solitude, there are some species who hibernate in groups. This is so they can preserve warmth in their dens through the winter.
Cold blooded animals still produce body heat, just like you feel warmer after exercise. They may not have any methods to keep their body temperature much higher than the surroundings, but wouldn’t want to become too cold either.
Edit:
https://faunafacts.com/do-snakes-cuddle/