This phrase, "Making the beast with two backs", was used around 1633 in William Shakespeare's Othello (Act 1, Scene 1, ll. 126-127): I am one, sir, that comes to tell you your daughter and the Moor are now making the beast with two backs. Noting it as a graphic image, two people are joined at the hip. They are facing each other and appearing to be one animal, with two backs facing outward. This is the beast (animal) with two backs. It is clearly meant to have a real sexual connotation.

In Shakespeare’s time, he is using slang, idioms, fun phrases, as well as what we might call poetic language to make a point or gain the attention of the audience. Here, in Othello, we find that the phrase is used for fun and to playfully refer to Othello and Desdemona making love.

More Info: en.wikipedia.org