It's often linked to a tradition in Great Dunmow, England.
In the town of Great Dunmow in Essex, England, a tradition stretching back to medieval times offered a flitch, a whole cured side of bacon, to any married couple who could swear they hadn't quarreled or regretted their marriage for a year and a day. Couples who convinced a jury carried the bacon home in triumph. The Dunmow Flitch Trials are still held every few years as a festive mock trial.
The tradition was famous enough that Geoffrey Chaucer mentioned the Dunmow flitch in The Canterbury Tales in the 1300s.
Historians aren't certain this custom is the direct source of the phrase. "Bring home the bacon" in its modern sense, earning a living or winning, became popular in the early 1900s. One well-known use came in 1906, when boxer Joe Gans's mother sent him a telegram before a fight telling him to bring home the bacon.
Either way, bacon has long stood for prosperity and reward.