Snakes, by nature, are solitary animals.
They don't need or enjoy each other's company.
In fact, it can be detrimental to your snake's health to house it with another snake, especially a different species.
I will list several reasons why you should not house multiple snakes in one enclosure for any reason other than breeding.
Having another snake in the same enclosure can stress your snake out.
Snakes that are stressed may fall victim to a host of health problems that may not be visually apparent.
They may also stop eating.
The two snakes must compete for the best hiding places and hot spots.
Two males may begin to combat and even injure each other.
The spread of disease is unstoppable if one snake becomes ill. That means two trips to the vet and two vet bills.
The two snakes may require different environments to thrive.
Unintentional breeding may occur before the female is physically ready.
This can lead to some serious health problems including death.
Cannibalism may occur with certain species.
Feeding both in the same enclosure is nearly impossible and definitely not safe.
Proper record keeping may be difficult.
If one regurgitates or has an unhealthy looking bowel movement, it will be impossible to tell which it was.
One snake may be dangerously larger than the other and may injure the smaller one.
If you intend to breed the two snakes to each other, your chances are increased if they are only together for breeding versus all year round.
That being said, people could argue each of those points and say "I have housed these two snakes together for years
without any problems." But that is not necessarily true, nor is it the best way to care for your snakes.
It is inexpensive and infinitely better for your snakes to give them the care they deserve and house them separately.
It will make their lives better and yours easier down the road.