Some of these beetles were piled in a clump, as if they were struggling with each other.
Others were mating.
In some cases, more than two were involved in a mating session. I saw a few triple-decker mating groups. It is amazing that they can keep their balance in a position like that.
In the photo above, three are piled up, and a fourth looks like it wants to join. Three seemed to be the maximum number that would work, though. When more beetles got involved, the stack would usually fall apart.