The League of Nations was formed after World War I primarily to prevent future wars by promoting international cooperation and maintaining peace. It aimed to achieve this through mechanisms like collective security, disarmament, and diplomatic dispute resolution.