6 Answers
6

Based on a first glance, it's looking like the original expression is "have a monkey on the roof," meaning a mortgage, dating back to the 1800s. Later "on the back" forms referred to any unpleasant burden, and in the 1940s began to be applied to narcotics addiction. No citations worth posting here, so the above is speculative.

The earliest references to piggybacking monkeys involve the backs of other animals. Of these, the earliest I found were references to the cruel and ancient history of dancing bears, accounts of monkeys on baited ponies, and on show camels. In 1807, sportswriter Pierce Egan wrote of a monkey riding a horse. These seem relevant because of their proximity in time to the phrase first being used figuratively and because, in most of these anecdotes, the monkey is either frightening the animal or symbolizing its subjugation.

In 1822, Thomas Gillett published a collection of stories as The Midland Minstrel that included a humorous tale called "The Devil and the Doctor" about some students who teach their overzealous instructor a lesson by dropping a monkey on his back while he's riding his horse home one night. He's convinced the monkey is the devil and, after a mad dash through town, sees the error of his ways. This attribution of evil to the monkey is significant and evolves in later citations.

Without question, the habit of
precaution which prompted him to
secure his buttons, alone prevented
the abstraction of his pocket-book,
and two five-pound Bank of England
notes—an admirable piece of ingenuity,
which has only been nullified by that
purely legal process called docking an
entail ! The abridged retires from
society with a monkey on his back, and
bequeathing a cordial benediction to
the author of this diabolical 'Essay
on Man.'

The italics were in the original, indicating, I think, the phrase was not in common use at the time. Its meaning is not entirely clear from its context of a man avoiding a pickpocket scheme at a fair. There may be a monetary debt connotation here. We do see a continuation of the monkey-as-devil theme in the use of diabolical.

MONKEY. 'I've put your monkey up,' is a phrase implying, I've roused your spirit, or offended you. 'I've put up your back,' is an equivalent, which see. A child is said to have the monkey on its back, when in ill humour, or out of temper.

Monkey, spirit or ill temper; 'to get one's Monkey up,' to rouse his passion. A man is said to have his Monkey up or the Monkey on his back, when he is 'riled,' or out of temper; this is old, and was probably in allusion originally to the evil spirit which was supposed to lie always present with a man; also under similar circumstances a man is said to have his back or hump up.

Other literary references from the turn of the century reinforce this idea of the monkey as an evil spirit making someone do something they wouldn't otherwise, e.g, this from A Rational Marriage, 1899:

Mealy, will you forgive me for that box on the ear ? It was a beastly thing of me to do ; but I felt a bit ' at bay,' my dear, which you must take on trust, because I can't explain it to you. I had the black monkey on my back ; but it's off again now, and I'm awfully sorry I avenged my own bad temper upon you.

The original reference was to addiction, specifically to heroin, and there are several songs that use it in this way. These days people use it to refer to any compulsion or obligation, including good ones.

There's a much more ancient tale involving a monkey on somebody else's back, namely the fable by Aesop (who lived circa 620–564 BCE) that is known in English as The Monkey and the Dolphin. This version is translated by George Fyler Townsend:

A Sailor, bound on a long voyage, took with him a Monkey to amuse him while on shipboard. As he sailed off the coast of Greece, a violent tempest arose in which the ship was wrecked and he, his Monkey, and all the crew were obliged to swim for their lives. A Dolphin saw the Monkey contending with the waves, and supposing him to be a man (whom he is always said to befriend), came and placed himself under him, to convey him on his back in safety to the shore. When the Dolphin arrived with his burden in sight of land not far from Athens, he asked the Monkey if he were an Athenian. The latter replied that he was, and that he was descended from one of the most noble families in that city. The Dolphin then inquired if he knew the Piraeus (the famous harbor of Athens). Supposing that a man was meant, the Monkey answered that he knew him very well and that he was an intimate friend. The Dolphin, indignant at these falsehoods, dipped the Monkey under the water and drowned him.