1- One possible reason is that Imam Mahdi (a) represents the continuation of Imamate and the final Imam, and since Kufa was Imam Ali’s (a) capital, Allah wants him to continue the legacy of Imamate there.
2- People did not let Imam Ali rule in Kufa. He was killed after 4 years, and so many wars were waged against him, so Allah wants Imam Mahdi to rule there to show everyone the justice of Ali.
3- Kufa, logistically, has benefits over Mecca. It has a permanent river (Euphrates) that allows for farming and availability of water year round. It can support bigger populations. Mecca’s geography (rugged mountains) is more difficult to sustain big populations permanently.
4- Since record numbers will be going for Hajj, imagine tens of millions in his era, then Mecca may not be a suitable place for him to run the global government.
Allah knows best.