The Spacelock was an embargo set by the God of Space, Palkia, after excessive use of Space Travel threatened to destabilise Space itself.
It occured following The League Civil War, when Palkia returned to his duties as Master of Space. By manipulating the strings that bind space together, Palkia sealed the opening of Slipspace portals. This prevented the now reformed League from establishing Trade routes with their member race's planets and caused economic instability. Aftershocks from the many Slipspace accidents also caused the formation of the Objects.
The Lock lasted for 8 years, finally ending when Dialga convinced Palkia that the League would eventually go to war again due to overpopulation if they couldn't expand. The Objects also stood to outline the danger of leaving Space unguarded. Following this, Palkia re-aligned the strands of Space, restoring the utility of Slipspace and allowing the fledgling League to continue its halted expansion, as well as returning to his duties as Guardian of Space.