Taking a pact with the devil means selling your own soul in exchange for saving 1000 lives. It’s an ultimate sacrifice in the name of good. The act itself is good, but it will lead to greater evil to corrupt your soul in the end.
Not taking a pact is selfish, but not really evil. People will die without your interference. But you’re not evil by choosing not to sacrifice your soul in order to save them.