It depends on the species of snake and the size of the tank. Corn snakes will fight if both are either male or female. Snakes are generally solitary animals. If housed together they may turn to cannabalism. There is also the greater possibility of spreading disease if they live together. It's probably best to keep each one in its own tank.