The most obvious reason is that they do it for UVB rays and heat. Your turtles may not be getting enough rays. This forces them to look for a way to get the rays. When they are on top of each other, the top turtle has the most advantage, but this doesn’t mean they will fight for that position. Even the turtle beneath do gain from stacking.