Megara's unfinished business was to help Hercules complete his Twelfth Trial. Her death occurs while
running away from Cerberus at the same time Hercules is felled by the beast.
Hades (both in classic mythology and OuaT) has a singular purpose: prevent souls from leaving the Underworld. To this end, concerning Hercules and Megara, Hades
locks up Megara as a prisoner for 40-ish years under guard from Cerberus. This prevents Hercules from finding Megara, which would give him the confidence and/or drive to challenge and defeat Cerberus (and in the OuaT mythology, and actual helping hand in the battle).
This effectively prevents both Megara and Hercules from finishing their unfinished business, notching two stuck souls for Hades. After completion of the Twelfth Trial, both Hercules and Megara have completed their unfinished business (the actual completion and helping with completion, respectively), and they are free to leave the Underworld for "a better place".