In the case of monkeys, it is indeed a display of dominance. Sexual displays are common in primates. It is the stronger monkey telling the weaker one "I am Alpha, I can do what I like including butt raping you and you cannot do anything about it" but after the butt raping is over, the Alpha monkey goes off and screws all the females in the tree. It is analogous to male prisoners butt raping other male prisoners without being homosexual. It is a display of dominance of the strong prisoner over the weaker one and goes no further than that. The dominant prisoner will still go back to his wife or girlfriend after he is released and have conjugal visits with her while he is still inside.