i agree that it was a act of dominance. your boy was violated. ):
they will sometimes put a rival of the same sex in their place without the presence of the opposite sex to show dominance sometimes by locking. however they battle/wrestle over mates. here's 2.0 Carpet Pythons fighting over a girl.