G-d had already sealed the fate of the rebels. G-d instructed Moshe to save the folks that followed Dathan and Aviram in their open defiance and accusations that Moshe was a despot and lair. Moshe wanted G-d to spare his enemies if they would repent. They didn’t and thus Dathan and Aviram and his followers were destroyed.
The Rebbe explains: “Dathan and Aviram had openly demonstrated their animosity toward Moses, accusing him of being a despot and an impostor. Moreover, G‑d Himself had already sealed their punishment, instructing Moses only to save the other rebels from Dathan and Aviram’s impending fate. Still, Moses did not give up hope that his “enemies” would repent, doing everything in his power to influence them to reconsider.
We learn from Moses to always do whatever we can to bring our brethren back to G‑d and His Torah – even when it seems that all hope is lost. This is true even when they are ignoring their faith intentionally, and all the more so when they are acting out of ignorance.1”