The Rambam (Hilchot Melachim 4:10) says that "one does not appoint a king except to perform judgment and war".
Moshe did two things before being forced to flee Egypt. He killed the Egyptian, thereby protecting the Jew who was under attack. The next day, he tried to resolve a conflict which had developed between two Jews.
By fighting back against Egyptian oppression, and trying to obtain justice between Jews, Moshe performed both of the tasks expected of Jewish kings. No wonder he was chosen as Israel's future leader.
Source: R' Yuval Sherlo in Tzohar LeShabat for this week, parshat Vaera