Because the Mughal Empire was ruled by a Chagatai Turkic dynasty which was a Persianate - as in deeply influenced by the Persian culture and language, despite being Turkic in origin. Due to that, Persian was the official language of the Empire.