From the Ghostbusters Wiki:
The origin of the Mood Slime is tied to a juvenile Sloar, held in Shandor's Island, beneath the Hudson River.
Before his death, Ivo Shandor and his Cult of Gozer had somehow lured the young Sloar from its home hell dimension and imprisoned it in our world within a Ghostworld pocket at the heart of Shandor's island mansion. Fueled by hatred, bile and anger the creature produced a steady stream of Black Slime.
Ivo Shandor, through experimentation and using equipment decades ahead of it's time, converted the Black Slime into what became known as the Mood Slime, which was then pumped directly into New York's sewers and abandoned tunnels, possibly as a means to help Gozer's crossing over.
This act was later used by Vigo to his own advantage.