The phrase has its origins in the practice of "jumping" and robbing people in gay havens and brothels of the 19th century because no one would report the crimes.
"Molly" by itself meant a gay or effeminate man or a "dyke" on the streets of London and NYC since 18th century. "Molly houses" were gay (male or female) and cross dresser's brothels or hang outs. Soon the "hop" and "wopped" was added (probably versions now used more in the east coast, and the UK) also first used in London and New York. Slightly altered in pronunciation and meaning as it filtered over time and space. Now anyone can get molly-hopped. Unsurprisingly though it still is most often used when a woman (especially a woman who is "street" herself), or effeminate man (or just a man deemed to be a chump) is assaulted in this way. (Apparently the "'hood" has been hardcore for a long, long time.)