As memory serves there were multiple motives.
First, Egyptian Khedival authorities were non-too happy about the Mahdists, whose propaganda wasn’t considered too friendly to them as corrupt collaborators with the
Second, local British army officers were looking for promotions and glory.
Third, there was a sense even up to cooler heads that the Mahdist state was a long-term threat to the Khedival system (whole corruption, collaboration with the foreign imperialists, etc). Remember it was the Ottomans that originally brought Sudan under Egyptian rule and there was, as I recall, a lot of too-ing and fro-ing…
But I bet Tamerlane knows the history better than I, since I am just an imperial history dabbler.